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.18 by jsr166, Fri Nov 5 00:17:22 2010 UTC vs.
Revision 1.22 by jsr166, Fri May 27 19:10:32 2011 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7   import junit.framework.*;
# Line 280 | Line 280 | public class TreeSetTest extends JSR166T
280      public void testRemoveElement() {
281          TreeSet q = populatedSet(SIZE);
282          for (int i = 1; i < SIZE; i+=2) {
283 <            assertTrue(q.remove(new Integer(i)));
283 >            assertTrue(q.contains(i));
284 >            assertTrue(q.remove(i));
285 >            assertFalse(q.contains(i));
286 >            assertTrue(q.contains(i-1));
287          }
288          for (int i = 0; i < SIZE; i+=2) {
289 <            assertTrue(q.remove(new Integer(i)));
290 <            assertFalse(q.remove(new Integer(i+1)));
289 >            assertTrue(q.contains(i));
290 >            assertTrue(q.remove(i));
291 >            assertFalse(q.contains(i));
292 >            assertFalse(q.remove(i+1));
293 >            assertFalse(q.contains(i+1));
294          }
295          assertTrue(q.isEmpty());
296      }
# Line 515 | Line 521 | public class TreeSetTest extends JSR166T
521          TreeSet q = populatedSet(SIZE);
522          String s = q.toString();
523          for (int i = 0; i < SIZE; ++i) {
524 <            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
524 >            assertTrue(s.contains(String.valueOf(i)));
525          }
526      }
527  
# Line 844 | Line 850 | public class TreeSetTest extends JSR166T
850       */
851      void check(NavigableSet<Integer> set,
852                        final int min, final int max, final boolean ascending) {
853 <       class ReferenceSet {
853 >        class ReferenceSet {
854              int lower(int element) {
855                  return ascending ?
856                      lowerAscending(element) : higherAscending(element);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines