Misc Java code.