Commonly useful Java code.