diff --git a/java/src/main/java/euler/p0007.java b/java/src/main/java/euler/p0007.java index 605480f3..cec11e84 100644 --- a/java/src/main/java/euler/p0007.java +++ b/java/src/main/java/euler/p0007.java @@ -15,9 +15,10 @@ public class p0007 implements IEuler { @Override public Object answer() { - return (int) Primes.primes() - .skip(10000) - .findFirst() - .orElseThrow(() -> new RuntimeException("Prime number not found")); + return Primes.primes() + .skip(10000) + .findFirst() + .get() + .intValue(); } } \ No newline at end of file