JAVA determines whether an integer is a prime number