ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/Collection8Test.java
(Generate patch)

Comparing jsr166/src/test/tck/Collection8Test.java (file contents):
Revision 1.18 by jsr166, Sun Nov 6 20:53:53 2016 UTC vs.
Revision 1.19 by jsr166, Sun Nov 6 22:42:10 2016 UTC

# Line 98 | Line 98 | public class Collection8Test extends JSR
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);
# Line 256 | Line 256 | public class Collection8Test extends JSR
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;
# Line 378 | Line 378 | public class Collection8Test extends JSR
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++)
# Line 394 | Line 394 | public class Collection8Test extends JSR
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++)
# Line 412 | Line 412 | public class Collection8Test extends JSR
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  
# Line 446 | Line 446 | public class Collection8Test extends JSR
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()) {
# Line 470 | Line 470 | public class Collection8Test extends JSR
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  
# Line 504 | Line 504 | public class Collection8Test extends JSR
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()) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines