Miscellaneous Java code I've written over the years...