@Test public void nextIntValueBounded() { checkDistribution( () -> randomValues.nextIntValue( BOUND ) ); checkBounded( () -> randomValues.nextIntValue( BOUND ) ); }
/** * @see RandomValues */ public NumberValue nextNumberValue() { int type = generator.nextInt( 6 ); switch ( type ) { case 0: return nextByteValue(); case 1: return nextShortValue(); case 2: return nextIntValue(); case 3: return nextLongValue(); case 4: return nextFloatValue(); case 5: return nextDoubleValue(); default: throw new IllegalArgumentException( "Unknown value type " + type ); } }
int operationType = randomValues.nextIntValue( 3 ).value(); switch ( operationType )
return nextTextValue(); case INT: return nextIntValue(); case LONG: return nextLongValue();
/** * @see RandomValues */ public NumberValue nextNumberValue() { int type = generator.nextInt( 6 ); switch ( type ) { case 0: return nextByteValue(); case 1: return nextShortValue(); case 2: return nextIntValue(); case 3: return nextLongValue(); case 4: return nextFloatValue(); case 5: return nextDoubleValue(); default: throw new IllegalArgumentException( "Unknown value type " + type ); } }
return nextTextValue(); case INT: return nextIntValue(); case LONG: return nextLongValue();