36 |
|
*/ |
37 |
|
public void testBadStreamSize() { |
38 |
|
ThreadLocalRandom r = ThreadLocalRandom.current(); |
39 |
< |
Runnable[] throwingActions = { |
39 |
> |
assertThrows( |
40 |
> |
IllegalArgumentException.class, |
41 |
|
() -> r.ints(-1L), |
42 |
|
() -> r.ints(-1L, 2, 3), |
43 |
|
() -> r.longs(-1L), |
44 |
|
() -> r.longs(-1L, -1L, 1L), |
45 |
|
() -> r.doubles(-1L), |
46 |
< |
() -> r.doubles(-1L, .5, .6), |
46 |
< |
}; |
47 |
< |
assertThrows(IllegalArgumentException.class, throwingActions); |
46 |
> |
() -> r.doubles(-1L, .5, .6)); |
47 |
|
} |
48 |
|
|
49 |
|
/** |
52 |
|
*/ |
53 |
|
public void testBadStreamBounds() { |
54 |
|
ThreadLocalRandom r = ThreadLocalRandom.current(); |
55 |
< |
Runnable[] throwingActions = { |
55 |
> |
assertThrows( |
56 |
> |
IllegalArgumentException.class, |
57 |
|
() -> r.ints(2, 1), |
58 |
|
() -> r.ints(10, 42, 42), |
59 |
|
() -> r.longs(-1L, -1L), |
60 |
|
() -> r.longs(10, 1L, -2L), |
61 |
|
() -> r.doubles(0.0, 0.0), |
62 |
< |
() -> r.doubles(10, .5, .4), |
63 |
< |
}; |
64 |
< |
assertThrows(IllegalArgumentException.class, throwingActions); |
62 |
> |
() -> r.doubles(10, .5, .4)); |
63 |
|
} |
64 |
|
|
65 |
|
/** |