P31 { public static boolean isPrime(long number) { return !LongStream.rangeClosed(2, Math.round(Math.sqrt(number))).anyMatch(n -> number % n == 0); }  static boolean isPrime(long number);  }
@Test public void shouldSay7IsAPrimeNumber() throws Exception { boolean prime = P31.isPrime(7); assertTrue(prime); }
@Test public void shouldSay10IsNotAPrimeNumber() throws Exception { boolean prime = P31.isPrime(10); assertFalse(prime); }