< prev index next >

test/jdk/java/util/concurrent/tck/Collection8Test.java

Print this page
8234131: Miscellaneous changes imported from jsr166 CVS 2021-01
Reviewed-by: martin

@@ -438,11 +438,10 @@
         for (int i = rnd.nextInt(n + 1); --i >= 0; ) {
             assertTrue(s.tryAdvance(e -> {}));
             if (rnd.nextBoolean()) assertTrue(it.hasNext());
             it.next();
         }
-        Consumer alwaysThrows = e -> { throw new AssertionError(); };
         // TODO: many more removal methods
         if (rnd.nextBoolean()) {
             for (Iterator z = c.iterator(); z.hasNext(); ) {
                 Object e = z.next();
                 if (rnd.nextBoolean()) {

@@ -659,11 +658,10 @@
     /**
      * stream().forEach returns elements in the collection
      */
     public void testStreamForEach() throws Throwable {
         final Collection c = impl.emptyCollection();
-        final AtomicLong count = new AtomicLong(0L);
         final Object x = impl.makeElement(1);
         final Object y = impl.makeElement(2);
         final ArrayList found = new ArrayList();
         Consumer<Object> spy = o -> found.add(o);
         c.stream().forEach(spy);

@@ -717,11 +715,10 @@
     /**
      * collection.forEach returns elements in the collection
      */
     public void testForEach() throws Throwable {
         final Collection c = impl.emptyCollection();
-        final AtomicLong count = new AtomicLong(0L);
         final Object x = impl.makeElement(1);
         final Object y = impl.makeElement(2);
         final ArrayList found = new ArrayList();
         Consumer<Object> spy = o -> found.add(o);
         c.forEach(spy);
< prev index next >