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

Comparing jsr166/src/test/tck/TreeSubSetTest.java (file contents):
Revision 1.37 by jsr166, Fri Aug 4 03:30:22 2017 UTC vs.
Revision 1.38 by jsr166, Mon May 28 21:19:50 2018 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines