If you're gonna shoot, shoot!, Don't talk.!
public class Math { public static boolean isPrime(final long number) { if (number % 2 == 0) return false; long maxCheck = (long) Math.sqrt(number); for (long i = 2; i <= maxCheck; i++) { if(number % i == 0) return false; } return true; } }