98 |
|
assertSame(3, a[2]); |
99 |
|
} |
100 |
|
assertIteratorExhausted(c.iterator()); |
101 |
< |
Consumer alwaysThrows = (e) -> { throw new AssertionError(); }; |
101 |
> |
Consumer alwaysThrows = e -> { throw new AssertionError(); }; |
102 |
|
c.forEach(alwaysThrows); |
103 |
|
c.iterator().forEachRemaining(alwaysThrows); |
104 |
|
c.spliterator().forEachRemaining(alwaysThrows); |
256 |
|
ArrayList accepts = new ArrayList(); |
257 |
|
ArrayList rejects = new ArrayList(); |
258 |
|
|
259 |
< |
Predicate randomPredicate = (e) -> { |
259 |
> |
Predicate randomPredicate = e -> { |
260 |
|
assertNull(threwAt.get()); |
261 |
|
switch (rnd.nextInt(3)) { |
262 |
|
case 0: accepts.add(e); return true; |
378 |
|
assertEquals(impl.makeElement(0), it.next()); |
379 |
|
assertTrue(it.hasNext()); |
380 |
|
assertEquals(impl.makeElement(1), it.next()); |
381 |
< |
it.forEachRemaining((e) -> {}); |
381 |
> |
it.forEachRemaining(e -> {}); |
382 |
|
it.remove(); |
383 |
|
assertEquals(n - 1, c.size()); |
384 |
|
for (int i = 0; i < n - 1; i++) |
394 |
|
assertEquals(impl.makeElement(n - 1), it.next()); |
395 |
|
assertTrue(it.hasNext()); |
396 |
|
assertEquals(impl.makeElement(n - 2), it.next()); |
397 |
< |
it.forEachRemaining((e) -> {}); |
397 |
> |
it.forEachRemaining(e -> {}); |
398 |
|
it.remove(); |
399 |
|
assertEquals(n - 1, d.size()); |
400 |
|
for (int i = 1; i < n; i++) |
412 |
|
final Object x = impl.makeElement(1); |
413 |
|
final Object y = impl.makeElement(2); |
414 |
|
final ArrayList found = new ArrayList(); |
415 |
< |
Consumer<Object> spy = (o) -> { found.add(o); }; |
415 |
> |
Consumer<Object> spy = o -> { found.add(o); }; |
416 |
|
c.stream().forEach(spy); |
417 |
|
assertTrue(found.isEmpty()); |
418 |
|
|
446 |
|
Runnable checkElt = () -> { |
447 |
|
threadsStarted.countDown(); |
448 |
|
while (!done.get()) |
449 |
< |
c.stream().forEach((x) -> { assertSame(x, elt); }); }; |
449 |
> |
c.stream().forEach(x -> { assertSame(x, elt); }); }; |
450 |
|
Runnable addRemove = () -> { |
451 |
|
threadsStarted.countDown(); |
452 |
|
while (!done.get()) { |
470 |
|
final Object x = impl.makeElement(1); |
471 |
|
final Object y = impl.makeElement(2); |
472 |
|
final ArrayList found = new ArrayList(); |
473 |
< |
Consumer<Object> spy = (o) -> { found.add(o); }; |
473 |
> |
Consumer<Object> spy = o -> { found.add(o); }; |
474 |
|
c.forEach(spy); |
475 |
|
assertTrue(found.isEmpty()); |
476 |
|
|
504 |
|
Runnable checkElt = () -> { |
505 |
|
threadsStarted.countDown(); |
506 |
|
while (!done.get()) |
507 |
< |
c.forEach((x) -> { assertSame(x, elt); }); }; |
507 |
> |
c.forEach(x -> { assertSame(x, elt); }); }; |
508 |
|
Runnable addRemove = () -> { |
509 |
|
threadsStarted.countDown(); |
510 |
|
while (!done.get()) { |