Assorted Java code