--- jsr166/src/test/tck/PriorityQueueTest.java 2009/11/22 18:57:17 1.15 +++ jsr166/src/test/tck/PriorityQueueTest.java 2010/11/04 01:04:54 1.18 @@ -13,7 +13,7 @@ import java.io.*; public class PriorityQueueTest 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(PriorityQueueTest.class); @@ -213,6 +213,7 @@ public class PriorityQueueTest extends J shouldThrow(); } catch (NullPointerException success) {} } + /** * addAll of a collection with null elements throws NPE */ @@ -224,6 +225,7 @@ public class PriorityQueueTest extends J shouldThrow(); } catch (NullPointerException success) {} } + /** * addAll of a collection with any null elements throws NPE after * possibly adding some elements @@ -406,7 +408,7 @@ public class PriorityQueueTest extends J Object[] o = q.toArray(); Arrays.sort(o); for (int i = 0; i < o.length; i++) - assertEquals(o[i], q.poll()); + assertSame(o[i], q.poll()); } /** @@ -415,10 +417,10 @@ public class PriorityQueueTest extends J public void testToArray2() { PriorityQueue q = populatedQueue(SIZE); Integer[] ints = new Integer[SIZE]; - ints = (Integer[])q.toArray(ints); + assertSame(ints, q.toArray(ints)); Arrays.sort(ints); for (int i = 0; i < ints.length; i++) - assertEquals(ints[i], q.poll()); + assertSame(ints[i], q.poll()); } /** @@ -438,7 +440,7 @@ public class PriorityQueueTest extends J /** * iterator.remove removes current element */ - public void testIteratorRemove () { + public void testIteratorRemove() { final PriorityQueue q = new PriorityQueue(3); q.add(new Integer(2)); q.add(new Integer(1));