public static int randomInt ( int startInclusive , int endExclusive ) { checkArgument ( startInclusive <= endExclusive , "End must be greater than or equal to start" ) ; if ( startInclusive == endExclusive ) { return startInclusive ; } return RANDOM . ints ( 1 , startInclusive , endExclusive ) . sum ( ) ; }
Returns a random int within the specified range .