Misc Kata in Java