https://github.com/sviperll/adt4j Also look at http://apocalisp.wordpress.com/2009/08/21/structural-pattern-matching-in-java/