Not much algorithm but a nice exercise on Java features.
interface Comparable
int compareTo(E o);
}
try {
} catch (Exception e) {
throw e; // rethrow
}
lambda expression
https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html
num -> {
for (int i = 2; i * i <= num; ++i) {
if (num % i == 0) return false;
}
return true;
}