@Test public void testCompadability() { PrimeIdentifier pi = new PrimeIdentifier(); for (Integer v : (new EratosthenesPrimeSearch()).getPrimesLessThan(1000000)) { assertTrue(pi.isPrime(v)); } }
@Test public void testPrimes() { boolean[] primes = { false, false, true, true, false, true, false, true, false, false, false, true, false, true }; PrimeIdentifier pi = new PrimeIdentifier(); for (int i = -1; i < primes.length; ++i) { assertEquals(pi.isPrime(i), i >= 0 ? primes[i] : false); } }