public BigInteger nextProbablePrime ()

Returns the first integer greater than this BigInteger that is probably prime. The probability that the number returned by this method is composite does not exceed 2-100. This method will never skip over a prime when searching: if it returns p, there is no prime q such that this < q < p.

Returns:  the first integer greater than this BigInteger that is probably prime.

Exceptions:
ArithmeticException    this < 0 or this is too large.

Since:  1.5