Java code for Project Euler examples