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.10 by jsr166, Sat Nov 21 17:38:06 2009 UTC vs.
Revision 1.11 by jsr166, Sun Nov 22 18:57:17 2009 UTC

# Line 19 | Line 19 | public class TreeSetTest extends JSR166T
19  
20      static class MyReverseComparator implements Comparator {
21          public int compare(Object x, Object y) {
22 <            int i = ((Integer)x).intValue();
23 <            int j = ((Integer)y).intValue();
24 <            if (i < j) return 1;
25 <            if (i > j) return -1;
26 <            return 0;
22 >            return ((Comparable)y).compareTo(x);
23          }
24      }
25  
# Line 259 | Line 255 | public class TreeSetTest extends JSR166T
255      public void testPollFirst() {
256          TreeSet q = populatedSet(SIZE);
257          for (int i = 0; i < SIZE; ++i) {
258 <            assertEquals(i, ((Integer)q.pollFirst()).intValue());
258 >            assertEquals(i, q.pollFirst());
259          }
260          assertNull(q.pollFirst());
261      }
# Line 270 | Line 266 | public class TreeSetTest extends JSR166T
266      public void testPollLast() {
267          TreeSet q = populatedSet(SIZE);
268          for (int i = SIZE-1; i >= 0; --i) {
269 <            assertEquals(i, ((Integer)q.pollLast()).intValue());
269 >            assertEquals(i, q.pollLast());
270          }
271          assertNull(q.pollFirst());
272      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines