diff --git a/exercises/nth-prime/src/example/java/PrimeCalculator.java b/exercises/nth-prime/src/example/java/PrimeCalculator.java index fa985b353..275af1454 100644 --- a/exercises/nth-prime/src/example/java/PrimeCalculator.java +++ b/exercises/nth-prime/src/example/java/PrimeCalculator.java @@ -33,10 +33,6 @@ private boolean isPrime(int n) { .rangeClosed(2, (int) Math.ceil(Math.sqrt(n))) .anyMatch((int i) -> n % i == 0); - if (divisible) { - return false; - } - - return true; + return !divisible; } }