Open wilsonpenha opened 7 years ago
public static boolean isPrime(List<Integer> primes, Integer candidate) { double candidateRoot = Math.sqrt((double) candidate); //return takeWhile(primes, i -> i <= candidateRoot).stream().noneMatch(i -> candidate % i == 0); return primes.stream().**takeWhile**(i -> i <= candidateRoot).noneMatch(i -> candidate % i == 0); }
-> the function takeWhile is invalid or doesn't exists
-> the function takeWhile is invalid or doesn't exists