Misc Java utilities