miscellaneous Java code