public static boolean isPrime(Number candidate) {
return primes().takeWhile(where(squared, lessThanOrEqualTo(candidate))).forAll(where(remainder(candidate), is(not(zero))));
}
public static LogicalPredicate<Number> remainderIs(final Number divisor, final Number remainder) {
return new RemainderIs(divisor, remainder);
}