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

Comparing jsr166/src/test/tck/TreeSetTest.java (file contents):
Revision 1.46 by jsr166, Sat Mar 11 18:20:47 2017 UTC vs.
Revision 1.48 by jsr166, Mon May 28 21:51:44 2018 UTC

# Line 454 | Line 454 | public class TreeSetTest extends JSR166T
454       */
455      public void testToArray() {
456          TreeSet q = populatedSet(SIZE);
457 <        Object[] o = q.toArray();
458 <        for (int i = 0; i < o.length; i++)
459 <            assertSame(o[i], q.pollFirst());
457 >        Object[] a = q.toArray();
458 >        assertSame(Object[].class, a.getClass());
459 >        for (Object o : a)
460 >            assertSame(o, q.pollFirst());
461 >        assertTrue(q.isEmpty());
462      }
463  
464      /**
# Line 467 | Line 469 | public class TreeSetTest extends JSR166T
469          Integer[] ints = new Integer[SIZE];
470          Integer[] array = q.toArray(ints);
471          assertSame(ints, array);
472 <        for (int i = 0; i < ints.length; i++)
473 <            assertSame(ints[i], q.pollFirst());
472 >        for (Integer o : ints)
473 >            assertSame(o, q.pollFirst());
474 >        assertTrue(q.isEmpty());
475      }
476  
477      /**
# Line 522 | Line 525 | public class TreeSetTest extends JSR166T
525      }
526  
527      /**
528 <     * A deserialized serialized set has same elements
528 >     * A deserialized/reserialized set equals original
529       */
530      public void testSerialization() throws Exception {
531          NavigableSet x = populatedSet(SIZE);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines