Misc Java testing codes