import java.util.stream.IntStream;

public final class PrimeCalculator {
    public int nth(int nth) {
        if (nth < 1) {
            throw new IllegalArgumentException();
        }

        int primesFound = 0;
        int possiblePrime = 1;

        while (primesFound < nth) {
            possiblePrime++;

            if (isPrime(possiblePrime)) {
                primesFound++;
            }
        }

        return possiblePrime;
    }

    private boolean isPrime(int n) {
        if (n == 1) {
            return false;
        }

        if (n == 2) {
            return true;
        }

        boolean divisible = IntStream
                .rangeClosed(2, (int) Math.ceil(Math.sqrt(n)))
                .anyMatch((int i) -> n % i == 0);

        return !divisible;
    }
}

@@ -29,23 +29,16 @@
 tream;%0A%0A
-public 
 final cl
@@ -67,15 +67,8 @@
     
-public 
 int 

remove public access modifiers on ref solution for nth prime