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

Comparing jsr166/src/test/tck/ConcurrentSkipListSubSetTest.java (file contents):
Revision 1.38 by jsr166, Sun Jan 7 22:59:18 2018 UTC vs.
Revision 1.39 by jsr166, Mon May 28 21:19:50 2018 UTC

# Line 407 | Line 407 | public class ConcurrentSkipListSubSetTes
407       */
408      public void testToArray() {
409          NavigableSet q = populatedSet(SIZE);
410 <        Object[] o = q.toArray();
411 <        for (int i = 0; i < o.length; i++)
412 <            assertSame(o[i], q.pollFirst());
410 >        Object[] a = q.toArray();
411 >        assertSame(Object[].class, a.getClass());
412 >        for (Object o : a)
413 >            assertSame(o, q.pollFirst());
414 >        assertTrue(q.isEmpty());
415      }
416  
417      /**
# Line 420 | Line 422 | public class ConcurrentSkipListSubSetTes
422          Integer[] ints = new Integer[SIZE];
423          Integer[] array = q.toArray(ints);
424          assertSame(ints, array);
425 <        for (int i = 0; i < ints.length; i++)
426 <            assertSame(ints[i], q.pollFirst());
425 >        for (Integer o : ints)
426 >            assertSame(o, q.pollFirst());
427 >        assertTrue(q.isEmpty());
428      }
429  
430      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines