Added nextprime to Java