# | Line 691 | Line 691 | public class TreeSetTest extends JSR166T | |
---|---|---|
691 | 0, setSize - 1, true); | |
692 | } | |
693 | ||
694 | + | /** |
695 | + | * addAll is idempotent |
696 | + | */ |
697 | + | public void testAddAll_idempotent() throws Exception { |
698 | + | Set x = populatedSet(SIZE); |
699 | + | Set y = new TreeSet(x); |
700 | + | y.addAll(x); |
701 | + | assertEquals(x, y); |
702 | + | assertEquals(y, x); |
703 | + | } |
704 | + | |
705 | static NavigableSet<Integer> newSet(Class cl) throws Exception { | |
706 | NavigableSet<Integer> result = (NavigableSet<Integer>) cl.newInstance(); | |
707 | assertEquals(0, result.size()); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |