As an exercise I'm converting some old code to functional streams. I don't know much about streams. It seems like it should be simple to convert this code, but I haven't had much luck. The method starts at a given integer, passes it to isPrime, which returns true if it's prime. and then hands off the new(next) prime number to be printed. If isPrime is false i is incremented and we check the next integer.
private static int nextPrime(final int number) {
int i = number + 1;
while (!isPrime(i)) {
i++;
}
return i;
}