562 |
|
final AtomicBoolean done = new AtomicBoolean(false); |
563 |
|
final Object one = impl.makeElement(1); |
564 |
|
final Object two = impl.makeElement(2); |
565 |
+ |
final Consumer checkSanity = x -> assertTrue(x == one || x == two); |
566 |
|
final Object[] emptyArray = |
567 |
|
(Object[]) java.lang.reflect.Array.newInstance(one.getClass(), 0); |
568 |
|
final List<Future<?>> futures; |
569 |
|
final Phaser threadsStarted = new Phaser(1); // register this thread |
569 |
– |
final Consumer checkSanity = x -> assertTrue(x == one || x == two); |
570 |
|
final Runnable[] frobbers = { |
571 |
|
() -> c.forEach(checkSanity), |
572 |
|
() -> c.stream().forEach(checkSanity), |