question: public static int nextSmallerPrime ( int n ) { if ( n <= 2 ) { return 1 ; } if ( n == 3 ) { return 2 ; } if ( ( n & 1 ) == 0 ) { n -- ; } else { n -= 2 ; } while ( n > 3 & ! isPrime ( n ) ) { n -= 2 ; } return n ; }
target:  Returns the largest prime smaller than the given integer