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