--- jsr166/src/test/tck/PriorityQueueTest.java 2021/01/26 13:33:06 1.48 +++ jsr166/src/test/tck/PriorityQueueTest.java 2021/01/27 01:57:24 1.49 @@ -122,7 +122,7 @@ public class PriorityQueueTest extends J */ public void testConstructor6() { Item[] items = defaultItems; - PriorityQueue q = new PriorityQueue(Arrays.asList(items)); + PriorityQueue q = new PriorityQueue<>(Arrays.asList(items)); for (int i = 0; i < SIZE; ++i) mustEqual(items[i], q.poll()); } @@ -133,7 +133,7 @@ public class PriorityQueueTest extends J public void testConstructor7() { MyReverseComparator cmp = new MyReverseComparator(); @SuppressWarnings("unchecked") - PriorityQueue q = new PriorityQueue(SIZE, cmp); + PriorityQueue q = new PriorityQueue<>(SIZE, cmp); assertEquals(cmp, q.comparator()); Item[] items = seqItems(SIZE); q.addAll(Arrays.asList(items)); @@ -145,7 +145,7 @@ public class PriorityQueueTest extends J * isEmpty is true before add, false after */ public void testEmpty() { - PriorityQueue q = new PriorityQueue(2); + PriorityQueue q = new PriorityQueue<>(2); assertTrue(q.isEmpty()); q.add(one); assertFalse(q.isEmpty()); @@ -174,7 +174,7 @@ public class PriorityQueueTest extends J * offer(null) throws NPE */ public void testOfferNull() { - PriorityQueue q = new PriorityQueue(1); + PriorityQueue q = new PriorityQueue<>(1); try { q.offer(null); shouldThrow(); @@ -185,7 +185,7 @@ public class PriorityQueueTest extends J * add(null) throws NPE */ public void testAddNull() { - PriorityQueue q = new PriorityQueue(1); + PriorityQueue q = new PriorityQueue<>(1); try { q.add(null); shouldThrow(); @@ -196,7 +196,7 @@ public class PriorityQueueTest extends J * Offer of comparable element succeeds */ public void testOffer() { - PriorityQueue q = new PriorityQueue(1); + PriorityQueue q = new PriorityQueue<>(1); assertTrue(q.offer(zero)); assertTrue(q.offer(one)); } @@ -205,7 +205,7 @@ public class PriorityQueueTest extends J * Offer of non-Comparable throws CCE */ public void testOfferNonComparable() { - PriorityQueue q = new PriorityQueue(1); + PriorityQueue q = new PriorityQueue<>(1); try { q.offer(new Object()); shouldThrow(); @@ -220,7 +220,7 @@ public class PriorityQueueTest extends J * add of comparable succeeds */ public void testAdd() { - PriorityQueue q = new PriorityQueue(SIZE); + PriorityQueue q = new PriorityQueue<>(SIZE); for (int i = 0; i < SIZE; ++i) { mustEqual(i, q.size()); mustAdd(q, i); @@ -231,7 +231,7 @@ public class PriorityQueueTest extends J * addAll(null) throws NPE */ public void testAddAll1() { - PriorityQueue q = new PriorityQueue(1); + PriorityQueue q = new PriorityQueue<>(1); try { q.addAll(null); shouldThrow(); @@ -242,7 +242,7 @@ public class PriorityQueueTest extends J * addAll of a collection with null elements throws NPE */ public void testAddAll2() { - PriorityQueue q = new PriorityQueue(SIZE); + PriorityQueue q = new PriorityQueue<>(SIZE); try { q.addAll(Arrays.asList(new Item[SIZE])); shouldThrow(); @@ -254,7 +254,7 @@ public class PriorityQueueTest extends J * possibly adding some elements */ public void testAddAll3() { - PriorityQueue q = new PriorityQueue(SIZE); + PriorityQueue q = new PriorityQueue<>(SIZE); Item[] items = new Item[2]; items[0] = zero; try { @@ -271,7 +271,7 @@ public class PriorityQueueTest extends J Item[] items = new Item[SIZE]; for (int i = 0; i < SIZE; ++i) items[i] = itemFor(SIZE - 1 - i); - PriorityQueue q = new PriorityQueue(SIZE); + PriorityQueue q = new PriorityQueue<>(SIZE); assertFalse(q.addAll(Arrays.asList(empty))); assertTrue(q.addAll(Arrays.asList(items))); for (int i = 0; i < SIZE; ++i) @@ -384,7 +384,7 @@ public class PriorityQueueTest extends J */ public void testContainsAll() { PriorityQueue q = populatedQueue(SIZE); - PriorityQueue p = new PriorityQueue(SIZE); + PriorityQueue p = new PriorityQueue<>(SIZE); for (int i = 0; i < SIZE; ++i) { assertTrue(q.containsAll(p)); assertFalse(p.containsAll(q)); @@ -478,7 +478,7 @@ public class PriorityQueueTest extends J * iterator.remove removes current element */ public void testIteratorRemove() { - final PriorityQueue q = new PriorityQueue(3); + final PriorityQueue q = new PriorityQueue<>(3); q.add(two); q.add(one); q.add(three);