code: public static int findNextPrime(int number) {
          // 2 is the smallest positive prime number.
          if (number <= 2)
              return 2;
  
          // Even numbers (other than 2) are not prime.
          if (isEven(number))
              ++number;
  
          if (number > MAX_PRIME_INTEGER)
              return number;
  
          // For safety, don't loop forever looking for a prime, and skip
          // all of the evens, as they are not prime (except 2).
          for (int next = number; next < number + 1000; next += 2) {
              if (isPrime(next))
                  return next;
          }
  
          return number;
      }
docs: Returns the next larger positive prime integer. <p>
  
  The integer specified will be returned if it is positive and a prime. <p>
  
  If the integer specified is greater than the maximumn prime integer, then
  the next odd integer will be returned.