--- jsr166/src/test/tck/ConcurrentSkipListSubSetTest.java 2009/11/21 10:29:50 1.10 +++ jsr166/src/test/tck/ConcurrentSkipListSubSetTest.java 2010/08/25 00:07:03 1.13 @@ -11,7 +11,7 @@ import java.io.*; public class ConcurrentSkipListSubSetTest extends JSR166TestCase { public static void main(String[] args) { - junit.textui.TestRunner.run (suite()); + junit.textui.TestRunner.run(suite()); } public static Test suite() { return new TestSuite(ConcurrentSkipListSubSetTest.class); @@ -19,11 +19,7 @@ public class ConcurrentSkipListSubSetTes static class MyReverseComparator implements Comparator { public int compare(Object x, Object y) { - int i = ((Integer)x).intValue(); - int j = ((Integer)y).intValue(); - if (i < j) return 1; - if (i > j) return -1; - return 0; + return ((Comparable)y).compareTo(x); } } @@ -229,7 +225,7 @@ public class ConcurrentSkipListSubSetTes public void testPoll() { NavigableSet q = populatedSet(SIZE); for (int i = 0; i < SIZE; ++i) { - assertEquals(i, ((Integer)q.pollFirst()).intValue()); + assertEquals(i, q.pollFirst()); } assertNull(q.pollFirst()); } @@ -342,7 +338,6 @@ public class ConcurrentSkipListSubSetTes Object e4 = q.lower(zero); assertNull(e4); - } /** @@ -361,7 +356,6 @@ public class ConcurrentSkipListSubSetTes Object e4 = q.higher(six); assertNull(e4); - } /** @@ -380,7 +374,6 @@ public class ConcurrentSkipListSubSetTes Object e4 = q.floor(zero); assertNull(e4); - } /** @@ -399,7 +392,6 @@ public class ConcurrentSkipListSubSetTes Object e4 = q.ceiling(six); assertNull(e4); - } /** @@ -456,7 +448,7 @@ public class ConcurrentSkipListSubSetTes /** * iterator.remove removes current element */ - public void testIteratorRemove () { + public void testIteratorRemove() { final NavigableSet q = set0(); q.add(new Integer(2)); q.add(new Integer(1)); @@ -735,7 +727,7 @@ public class ConcurrentSkipListSubSetTes public void testDescendingPoll() { NavigableSet q = populatedSet(SIZE); for (int i = 0; i < SIZE; ++i) { - assertEquals(i, ((Integer)q.pollFirst()).intValue()); + assertEquals(i, q.pollFirst()); } assertNull(q.pollFirst()); } @@ -848,7 +840,6 @@ public class ConcurrentSkipListSubSetTes Object e4 = q.lower(zero); assertNull(e4); - } /** @@ -867,7 +858,6 @@ public class ConcurrentSkipListSubSetTes Object e4 = q.higher(m6); assertNull(e4); - } /** @@ -886,7 +876,6 @@ public class ConcurrentSkipListSubSetTes Object e4 = q.floor(zero); assertNull(e4); - } /** @@ -905,7 +894,6 @@ public class ConcurrentSkipListSubSetTes Object e4 = q.ceiling(m6); assertNull(e4); - } /** @@ -962,7 +950,7 @@ public class ConcurrentSkipListSubSetTes /** * iterator.remove removes current element */ - public void testDescendingIteratorRemove () { + public void testDescendingIteratorRemove() { final NavigableSet q = dset0(); q.add(new Integer(2)); q.add(new Integer(1));