704 |
|
/** |
705 |
|
* Returns a random element from given choices. |
706 |
|
*/ |
707 |
+ |
<T> T chooseRandomly(List<T> choices) { |
708 |
+ |
return choices.get(ThreadLocalRandom.current().nextInt(choices.size())); |
709 |
+ |
} |
710 |
+ |
|
711 |
+ |
/** |
712 |
+ |
* Returns a random element from given choices. |
713 |
+ |
*/ |
714 |
|
<T> T chooseRandomly(T... choices) { |
715 |
|
return choices[ThreadLocalRandom.current().nextInt(choices.length)]; |
716 |
|
} |
1484 |
|
* wrapped in a CheckedRunnable. |
1485 |
|
*/ |
1486 |
|
Thread newStartedThread(Action action) { |
1487 |
< |
return newStartedThread(checkedRunnable(action)); |
1487 |
> |
return newStartedThread(checkedRunnable(action)); |
1488 |
|
} |
1489 |
|
|
1490 |
|
/** |
1779 |
|
|
1780 |
|
public int await() { |
1781 |
|
try { |
1782 |
< |
return super.await(2 * LONG_DELAY_MS, MILLISECONDS); |
1782 |
> |
return super.await(LONGER_DELAY_MS, MILLISECONDS); |
1783 |
|
} catch (TimeoutException timedOut) { |
1784 |
|
throw new AssertionError("timed out"); |
1785 |
|
} catch (Exception fail) { |