Just as a matter of interest, CC Mode has an extensive test suite for
indentation and fontification. It is available in directory /tests in
the mercurial repository which can be downloaded as detailed on
http://cc-mode.sourceforge.net/hgaccess.php. You might find the parts
dealing with Java and fontification interesting or useful. There are
instructions on use near the beginning of the file 000tests.el