Fun with Java abstract syntax trees. ASTVisitor.minify(String code) takes the contents of a valid Java file, creates an abstract syntax tree, and visits the tree to print out the code without any whitespace or comments (simple minification). See ASTVisitorTest for how to use it. Hopefully this can be helpful to somebody wondering how to use the built-in Java Abstract Syntax Tree libraries.