use of java8.util.SplittableRandom in project streamsupport by stefan-zobel.
the class SplittableRandomTest method testNextIntBoundNonPositive.
/**
* nextInt(non-positive) throws IllegalArgumentException
*/
public void testNextIntBoundNonPositive() {
SplittableRandom sr = new SplittableRandom();
Runnable[] throwingActions = { () -> sr.nextInt(-17), () -> sr.nextInt(0), () -> sr.nextInt(Integer.MIN_VALUE) };
assertThrows(IllegalArgumentException.class, throwingActions);
}
Aggregations