ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/LinkedBlockingDequeTest.java
(Generate patch)

Comparing jsr166/src/test/tck/LinkedBlockingDequeTest.java (file contents):
Revision 1.88 by dl, Tue Jan 26 13:33:06 2021 UTC vs.
Revision 1.90 by jsr166, Wed Jan 27 02:55:18 2021 UTC

# Line 59 | Line 59 | public class LinkedBlockingDequeTest ext
59       * Items 0 ... n - 1.
60       */
61      private static LinkedBlockingDeque<Item> populatedDeque(int n) {
62 <        LinkedBlockingDeque<Item> q =
63 <            new LinkedBlockingDeque<Item>(n);
62 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(n);
63          assertTrue(q.isEmpty());
64          for (int i = 0; i < n; i++)
65              mustOffer(q, i);
# Line 76 | Line 75 | public class LinkedBlockingDequeTest ext
75       * isEmpty is true before add, false after
76       */
77      public void testEmpty() {
78 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
78 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>();
79          assertTrue(q.isEmpty());
80          q.add(one);
81          assertFalse(q.isEmpty());
# Line 105 | Line 104 | public class LinkedBlockingDequeTest ext
104       * offerFirst(null) throws NullPointerException
105       */
106      public void testOfferFirstNull() {
107 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
107 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>();
108          try {
109              q.offerFirst(null);
110              shouldThrow();
# Line 116 | Line 115 | public class LinkedBlockingDequeTest ext
115       * offerLast(null) throws NullPointerException
116       */
117      public void testOfferLastNull() {
118 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
118 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>();
119          try {
120              q.offerLast(null);
121              shouldThrow();
# Line 127 | Line 126 | public class LinkedBlockingDequeTest ext
126       * OfferFirst succeeds
127       */
128      public void testOfferFirst() {
129 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
129 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>();
130          assertTrue(q.offerFirst(zero));
131          assertTrue(q.offerFirst(two));
132      }
# Line 136 | Line 135 | public class LinkedBlockingDequeTest ext
135       * OfferLast succeeds
136       */
137      public void testOfferLast() {
138 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
138 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>();
139          assertTrue(q.offerLast(zero));
140          assertTrue(q.offerLast(one));
141      }
# Line 390 | Line 389 | public class LinkedBlockingDequeTest ext
389       */
390      public void testConstructor6() {
391          Item[] items = defaultItems;
392 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(Arrays.asList(items));
392 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(Arrays.asList(items));
393          for (int i = 0; i < SIZE; ++i)
394              mustEqual(items[i], q.poll());
395      }
# Line 399 | Line 398 | public class LinkedBlockingDequeTest ext
398       * Deque transitions from empty to full when elements added
399       */
400      public void testEmptyFull() {
401 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(2);
401 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(2);
402          assertTrue(q.isEmpty());
403          mustEqual(2, q.remainingCapacity());
404          q.add(one);
# Line 431 | Line 430 | public class LinkedBlockingDequeTest ext
430       * push(null) throws NPE
431       */
432      public void testPushNull() {
433 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(1);
433 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(1);
434          try {
435              q.push(null);
436              shouldThrow();
# Line 442 | Line 441 | public class LinkedBlockingDequeTest ext
441       * push succeeds if not full; throws IllegalStateException if full
442       */
443      public void testPush() {
444 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
444 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
445          for (int i = 0; i < SIZE; ++i) {
446              Item x = itemFor(i);
447              q.push(x);
# Line 483 | Line 482 | public class LinkedBlockingDequeTest ext
482       * Offer succeeds if not full; fails if full
483       */
484      public void testOffer() {
485 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(1);
485 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(1);
486          assertTrue(q.offer(zero));
487          assertFalse(q.offer(one));
488      }
# Line 492 | Line 491 | public class LinkedBlockingDequeTest ext
491       * add succeeds if not full; throws IllegalStateException if full
492       */
493      public void testAdd() {
494 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
494 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
495          for (int i = 0; i < SIZE; ++i)
496              mustAdd(q, i);
497          mustEqual(0, q.remainingCapacity());
# Line 518 | Line 517 | public class LinkedBlockingDequeTest ext
517       * possibly adding some elements
518       */
519      public void testAddAll3() {
520 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
520 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
521          Item[] items = new Item[2]; items[0] = zero;
522          Collection<Item> elements = Arrays.asList(items);
523          try {
# Line 531 | Line 530 | public class LinkedBlockingDequeTest ext
530       * addAll throws IllegalStateException if not enough room
531       */
532      public void testAddAll4() {
533 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE - 1);
533 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE - 1);
534          Item[] items = defaultItems;
535          Collection<Item> elements = Arrays.asList(items);
536          try {
# Line 546 | Line 545 | public class LinkedBlockingDequeTest ext
545      public void testAddAll5() {
546          Item[] empty = new Item[0];
547          Item[] items = defaultItems;
548 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
548 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
549          assertFalse(q.addAll(Arrays.asList(empty)));
550          assertTrue(q.addAll(Arrays.asList(items)));
551          for (int i = 0; i < SIZE; ++i)
# Line 557 | Line 556 | public class LinkedBlockingDequeTest ext
556       * all elements successfully put are contained
557       */
558      public void testPut() throws InterruptedException {
559 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
559 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
560          for (int i = 0; i < SIZE; ++i) {
561              Item x = itemFor(i);
562              q.put(x);
# Line 570 | Line 569 | public class LinkedBlockingDequeTest ext
569       * put blocks interruptibly if full
570       */
571      public void testBlockingPut() throws InterruptedException {
572 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
572 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
573          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
574          Thread t = newStartedThread(new CheckedRunnable() {
575              public void realRun() throws InterruptedException {
# Line 607 | Line 606 | public class LinkedBlockingDequeTest ext
606       */
607      public void testPutWithTake() throws InterruptedException {
608          final int capacity = 2;
609 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(capacity);
609 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(capacity);
610          final CountDownLatch pleaseTake = new CountDownLatch(1);
611          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
612          Thread t = newStartedThread(new CheckedRunnable() {
# Line 647 | Line 646 | public class LinkedBlockingDequeTest ext
646       * timed offer times out if full and elements not taken
647       */
648      public void testTimedOffer() {
649 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(2);
649 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(2);
650          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
651          Thread t = newStartedThread(new CheckedRunnable() {
652              public void realRun() throws InterruptedException {
# Line 796 | Line 795 | public class LinkedBlockingDequeTest ext
795       * putFirst(null) throws NPE
796       */
797      public void testPutFirstNull() throws InterruptedException {
798 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
798 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
799          try {
800              q.putFirst(null);
801              shouldThrow();
# Line 807 | Line 806 | public class LinkedBlockingDequeTest ext
806       * all elements successfully putFirst are contained
807       */
808      public void testPutFirst() throws InterruptedException {
809 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
809 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
810          for (int i = 0; i < SIZE; ++i) {
811              Item x = itemFor(i);
812              q.putFirst(x);
# Line 820 | Line 819 | public class LinkedBlockingDequeTest ext
819       * putFirst blocks interruptibly if full
820       */
821      public void testBlockingPutFirst() throws InterruptedException {
822 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
822 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
823          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
824          Thread t = newStartedThread(new CheckedRunnable() {
825              public void realRun() throws InterruptedException {
# Line 857 | Line 856 | public class LinkedBlockingDequeTest ext
856       */
857      public void testPutFirstWithTake() throws InterruptedException {
858          final int capacity = 2;
859 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(capacity);
859 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(capacity);
860          final CountDownLatch pleaseTake = new CountDownLatch(1);
861          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
862          Thread t = newStartedThread(new CheckedRunnable() {
# Line 890 | Line 889 | public class LinkedBlockingDequeTest ext
889       * timed offerFirst times out if full and elements not taken
890       */
891      public void testTimedOfferFirst() {
892 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(2);
892 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(2);
893          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
894          Thread t = newStartedThread(new CheckedRunnable() {
895              public void realRun() throws InterruptedException {
# Line 936 | Line 935 | public class LinkedBlockingDequeTest ext
935       * takeFirst() blocks interruptibly when empty
936       */
937      public void testTakeFirstFromEmptyBlocksInterruptibly() {
938 <        final BlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
938 >        final BlockingDeque<Item> q = new LinkedBlockingDeque<>();
939          final CountDownLatch threadStarted = new CountDownLatch(1);
940          Thread t = newStartedThread(new CheckedRunnable() {
941              public void realRun() {
# Line 959 | Line 958 | public class LinkedBlockingDequeTest ext
958       * before waiting
959       */
960      public void testTakeFirstFromEmptyAfterInterrupt() {
961 <        final BlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
961 >        final BlockingDeque<Item> q = new LinkedBlockingDeque<>();
962          Thread t = newStartedThread(new CheckedRunnable() {
963              public void realRun() {
964                  Thread.currentThread().interrupt();
# Line 977 | Line 976 | public class LinkedBlockingDequeTest ext
976       * takeLast() blocks interruptibly when empty
977       */
978      public void testTakeLastFromEmptyBlocksInterruptibly() {
979 <        final BlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
979 >        final BlockingDeque<Item> q = new LinkedBlockingDeque<>();
980          final CountDownLatch threadStarted = new CountDownLatch(1);
981          Thread t = newStartedThread(new CheckedRunnable() {
982              public void realRun() {
# Line 1000 | Line 999 | public class LinkedBlockingDequeTest ext
999       * before waiting
1000       */
1001      public void testTakeLastFromEmptyAfterInterrupt() {
1002 <        final BlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
1002 >        final BlockingDeque<Item> q = new LinkedBlockingDeque<>();
1003          Thread t = newStartedThread(new CheckedRunnable() {
1004              public void realRun() {
1005                  Thread.currentThread().interrupt();
# Line 1110 | Line 1109 | public class LinkedBlockingDequeTest ext
1109       * on interruption throws
1110       */
1111      public void testTimedPollFirstWithOfferFirst() throws InterruptedException {
1112 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(2);
1112 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(2);
1113          final CheckedBarrier barrier = new CheckedBarrier(2);
1114          Thread t = newStartedThread(new CheckedRunnable() {
1115              public void realRun() throws InterruptedException {
# Line 1152 | Line 1151 | public class LinkedBlockingDequeTest ext
1151       * putLast(null) throws NPE
1152       */
1153      public void testPutLastNull() throws InterruptedException {
1154 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
1154 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
1155          try {
1156              q.putLast(null);
1157              shouldThrow();
# Line 1163 | Line 1162 | public class LinkedBlockingDequeTest ext
1162       * all elements successfully putLast are contained
1163       */
1164      public void testPutLast() throws InterruptedException {
1165 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
1165 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
1166          for (int i = 0; i < SIZE; ++i) {
1167              Item x = itemFor(i);
1168              q.putLast(x);
# Line 1176 | Line 1175 | public class LinkedBlockingDequeTest ext
1175       * putLast blocks interruptibly if full
1176       */
1177      public void testBlockingPutLast() throws InterruptedException {
1178 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(SIZE);
1178 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(SIZE);
1179          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
1180          Thread t = newStartedThread(new CheckedRunnable() {
1181              public void realRun() throws InterruptedException {
# Line 1213 | Line 1212 | public class LinkedBlockingDequeTest ext
1212       */
1213      public void testPutLastWithTake() throws InterruptedException {
1214          final int capacity = 2;
1215 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(capacity);
1215 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(capacity);
1216          final CountDownLatch pleaseTake = new CountDownLatch(1);
1217          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
1218          Thread t = newStartedThread(new CheckedRunnable() {
# Line 1253 | Line 1252 | public class LinkedBlockingDequeTest ext
1252       * timed offerLast times out if full and elements not taken
1253       */
1254      public void testTimedOfferLast() {
1255 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(2);
1255 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(2);
1256          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
1257          Thread t = newStartedThread(new CheckedRunnable() {
1258              public void realRun() throws InterruptedException {
# Line 1392 | Line 1391 | public class LinkedBlockingDequeTest ext
1391       * on interruption throws
1392       */
1393      public void testTimedPollWithOfferLast() throws InterruptedException {
1394 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(2);
1394 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(2);
1395          final CheckedBarrier barrier = new CheckedBarrier(2);
1396          Thread t = newStartedThread(new CheckedRunnable() {
1397              public void realRun() throws InterruptedException {
# Line 1480 | Line 1479 | public class LinkedBlockingDequeTest ext
1479       */
1480      public void testContainsAll() {
1481          LinkedBlockingDeque<Item> q = populatedDeque(SIZE);
1482 <        LinkedBlockingDeque<Item> p = new LinkedBlockingDeque<Item>(SIZE);
1482 >        LinkedBlockingDeque<Item> p = new LinkedBlockingDeque<>(SIZE);
1483          for (int i = 0; i < SIZE; ++i) {
1484              assertTrue(q.containsAll(p));
1485              assertFalse(p.containsAll(q));
# Line 1551 | Line 1550 | public class LinkedBlockingDequeTest ext
1550      /**
1551       * toArray(incompatible array type) throws ArrayStoreException
1552       */
1553 <    public void testToArray1_BadArg() {
1553 >    @SuppressWarnings("CollectionToArraySafeParameter")
1554 >    public void testToArray_incompatibleArrayType() {
1555          LinkedBlockingDeque<Item> q = populatedDeque(SIZE);
1556          try {
1557              q.toArray(new String[10]);
# Line 1582 | Line 1582 | public class LinkedBlockingDequeTest ext
1582       * iterator of empty collection has no elements
1583       */
1584      public void testEmptyIterator() {
1585 <        Deque<Item> c = new LinkedBlockingDeque<Item>();
1585 >        Deque<Item> c = new LinkedBlockingDeque<>();
1586          assertIteratorExhausted(c.iterator());
1587          assertIteratorExhausted(c.descendingIterator());
1588      }
# Line 1591 | Line 1591 | public class LinkedBlockingDequeTest ext
1591       * iterator.remove removes current element
1592       */
1593      public void testIteratorRemove() {
1594 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(3);
1594 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(3);
1595          q.add(two);
1596          q.add(one);
1597          q.add(three);
# Line 1610 | Line 1610 | public class LinkedBlockingDequeTest ext
1610       * iterator ordering is FIFO
1611       */
1612      public void testIteratorOrdering() {
1613 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(3);
1613 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(3);
1614          q.add(one);
1615          q.add(two);
1616          q.add(three);
# Line 1626 | Line 1626 | public class LinkedBlockingDequeTest ext
1626       * Modifications do not cause iterators to fail
1627       */
1628      public void testWeaklyConsistentIteration() {
1629 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(3);
1629 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(3);
1630          q.add(one);
1631          q.add(two);
1632          q.add(three);
# Line 1660 | Line 1660 | public class LinkedBlockingDequeTest ext
1660       * Descending iterator ordering is reverse FIFO
1661       */
1662      public void testDescendingIteratorOrdering() {
1663 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
1663 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>();
1664          for (int iters = 0; iters < 100; ++iters) {
1665              mustAdd(q, three);
1666              mustAdd(q, two);
# Line 1682 | Line 1682 | public class LinkedBlockingDequeTest ext
1682       * descendingIterator.remove removes current element
1683       */
1684      public void testDescendingIteratorRemove() {
1685 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
1685 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>();
1686          for (int iters = 0; iters < 100; ++iters) {
1687              mustAdd(q, three);
1688              mustAdd(q, two);
# Line 1715 | Line 1715 | public class LinkedBlockingDequeTest ext
1715       * offer transfers elements across Executor tasks
1716       */
1717      public void testOfferInExecutor() {
1718 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(2);
1718 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(2);
1719          q.add(one);
1720          q.add(two);
1721          final CheckedBarrier threadsStarted = new CheckedBarrier(2);
# Line 1741 | Line 1741 | public class LinkedBlockingDequeTest ext
1741       * timed poll retrieves elements across Executor threads
1742       */
1743      public void testPollInExecutor() {
1744 <        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>(2);
1744 >        final LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>(2);
1745          final CheckedBarrier threadsStarted = new CheckedBarrier(2);
1746          final ExecutorService executor = Executors.newFixedThreadPool(2);
1747          try (PoolCleaner cleaner = cleaner(executor)) {
# Line 1784 | Line 1784 | public class LinkedBlockingDequeTest ext
1784       */
1785      public void testDrainTo() {
1786          LinkedBlockingDeque<Item> q = populatedDeque(SIZE);
1787 <        ArrayList<Item> l = new ArrayList<Item>();
1787 >        ArrayList<Item> l = new ArrayList<>();
1788          q.drainTo(l);
1789          mustEqual(0, q.size());
1790          mustEqual(SIZE, l.size());
# Line 1814 | Line 1814 | public class LinkedBlockingDequeTest ext
1814              }});
1815  
1816          t.start();
1817 <        ArrayList<Item> l = new ArrayList<Item>();
1817 >        ArrayList<Item> l = new ArrayList<>();
1818          q.drainTo(l);
1819          assertTrue(l.size() >= SIZE);
1820          for (int i = 0; i < SIZE; ++i)
# Line 1827 | Line 1827 | public class LinkedBlockingDequeTest ext
1827       * drainTo(c, n) empties first min(n, size) elements of queue into c
1828       */
1829      public void testDrainToN() {
1830 <        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<Item>();
1830 >        LinkedBlockingDeque<Item> q = new LinkedBlockingDeque<>();
1831          for (int i = 0; i < SIZE + 2; ++i) {
1832              for (int j = 0; j < SIZE; j++)
1833                  mustOffer(q, j);
1834 <            ArrayList<Item> l = new ArrayList<Item>();
1834 >            ArrayList<Item> l = new ArrayList<>();
1835              q.drainTo(l, i);
1836              int k = (i < SIZE) ? i : SIZE;
1837              mustEqual(k, l.size());
# Line 1847 | Line 1847 | public class LinkedBlockingDequeTest ext
1847       */
1848      public void testNeverContainsNull() {
1849          Deque<?>[] qs = {
1850 <            new LinkedBlockingDeque<Object>(),
1850 >            new LinkedBlockingDeque<>(),
1851              populatedDeque(2),
1852          };
1853  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines