private static int nextPrime(int n) {
            if( n % 2 == 0 )
                n++;

            for( ; !isPrime( n ); n += 2 )
                ;

            return n;
        }
Internal method to find a prime number at least as large as n.
@param n the starting number (must be positive).
@return a prime number larger than or equal to n.
subs/gif-revert/src/main/java/com/engineer/gif/revert/lib/AnimatedGIFWriter.java