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

Comparing jsr166/src/test/tck/SynchronousQueueTest.java (file contents):
Revision 1.67 by jsr166, Mon Dec 16 22:55:54 2019 UTC vs.
Revision 1.68 by dl, Tue Jan 26 13:33:06 2021 UTC

# Line 51 | Line 51 | public class SynchronousQueueTest extend
51      public void testEmptyFull()      { testEmptyFull(false); }
52      public void testEmptyFull_fair() { testEmptyFull(true); }
53      public void testEmptyFull(boolean fair) {
54 <        final SynchronousQueue q = new SynchronousQueue(fair);
54 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
55          assertTrue(q.isEmpty());
56 <        assertEquals(0, q.size());
57 <        assertEquals(0, q.remainingCapacity());
56 >        mustEqual(0, q.size());
57 >        mustEqual(0, q.remainingCapacity());
58          assertFalse(q.offer(zero));
59      }
60  
# Line 64 | Line 64 | public class SynchronousQueueTest extend
64      public void testOffer()      { testOffer(false); }
65      public void testOffer_fair() { testOffer(true); }
66      public void testOffer(boolean fair) {
67 <        SynchronousQueue q = new SynchronousQueue(fair);
67 >        SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
68          assertFalse(q.offer(one));
69      }
70  
# Line 74 | Line 74 | public class SynchronousQueueTest extend
74      public void testAdd()      { testAdd(false); }
75      public void testAdd_fair() { testAdd(true); }
76      public void testAdd(boolean fair) {
77 <        SynchronousQueue q = new SynchronousQueue(fair);
78 <        assertEquals(0, q.remainingCapacity());
77 >        SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
78 >        mustEqual(0, q.remainingCapacity());
79          try {
80              q.add(one);
81              shouldThrow();
# Line 88 | Line 88 | public class SynchronousQueueTest extend
88      public void testAddAll_self()      { testAddAll_self(false); }
89      public void testAddAll_self_fair() { testAddAll_self(true); }
90      public void testAddAll_self(boolean fair) {
91 <        SynchronousQueue q = new SynchronousQueue(fair);
91 >        SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
92          try {
93              q.addAll(q);
94              shouldThrow();
95          } catch (IllegalArgumentException success) {}
96      }
97  
98 <    /**
98 >    /**S
99       * addAll throws IllegalStateException if no active taker
100       */
101      public void testAddAll_ISE()      { testAddAll_ISE(false); }
102      public void testAddAll_ISE_fair() { testAddAll_ISE(true); }
103      public void testAddAll_ISE(boolean fair) {
104 <        SynchronousQueue q = new SynchronousQueue(fair);
105 <        Integer[] ints = new Integer[1];
106 <        for (int i = 0; i < ints.length; i++)
107 <            ints[i] = i;
108 <        Collection<Integer> coll = Arrays.asList(ints);
104 >        SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
105 >        Item[] items = seqItems(1);
106 >        Collection<Item> coll = Arrays.asList(items);
107          try {
108              q.addAll(coll);
109              shouldThrow();
# Line 118 | Line 116 | public class SynchronousQueueTest extend
116      public void testBlockingPut()      { testBlockingPut(false); }
117      public void testBlockingPut_fair() { testBlockingPut(true); }
118      public void testBlockingPut(boolean fair) {
119 <        final SynchronousQueue q = new SynchronousQueue(fair);
119 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
120          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
121          Thread t = newStartedThread(new CheckedRunnable() {
122              public void realRun() throws InterruptedException {
123                  Thread.currentThread().interrupt();
124                  try {
125 <                    q.put(99);
125 >                    q.put(ninetynine);
126                      shouldThrow();
127                  } catch (InterruptedException success) {}
128                  assertFalse(Thread.interrupted());
129  
130                  pleaseInterrupt.countDown();
131                  try {
132 <                    q.put(99);
132 >                    q.put(ninetynine);
133                      shouldThrow();
134                  } catch (InterruptedException success) {}
135                  assertFalse(Thread.interrupted());
# Line 141 | Line 139 | public class SynchronousQueueTest extend
139          if (randomBoolean()) assertThreadBlocks(t, Thread.State.WAITING);
140          t.interrupt();
141          awaitTermination(t);
142 <        assertEquals(0, q.remainingCapacity());
142 >        mustEqual(0, q.remainingCapacity());
143      }
144  
145      /**
# Line 150 | Line 148 | public class SynchronousQueueTest extend
148      public void testPutWithTake()      { testPutWithTake(false); }
149      public void testPutWithTake_fair() { testPutWithTake(true); }
150      public void testPutWithTake(boolean fair) {
151 <        final SynchronousQueue q = new SynchronousQueue(fair);
151 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
152          final CountDownLatch pleaseTake = new CountDownLatch(1);
153          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
154          Thread t = newStartedThread(new CheckedRunnable() {
# Line 160 | Line 158 | public class SynchronousQueueTest extend
158  
159                  Thread.currentThread().interrupt();
160                  try {
161 <                    q.put(99);
161 >                    q.put(ninetynine);
162                      shouldThrow();
163                  } catch (InterruptedException success) {}
164                  assertFalse(Thread.interrupted());
165  
166                  pleaseInterrupt.countDown();
167                  try {
168 <                    q.put(99);
168 >                    q.put(ninetynine);
169                      shouldThrow();
170                  } catch (InterruptedException success) {}
171                  assertFalse(Thread.interrupted());
172              }});
173  
174          await(pleaseTake);
175 <        assertEquals(0, q.remainingCapacity());
175 >        mustEqual(0, q.remainingCapacity());
176          try { assertSame(one, q.take()); }
177          catch (InterruptedException e) { threadUnexpectedException(e); }
178  
# Line 182 | Line 180 | public class SynchronousQueueTest extend
180          if (randomBoolean()) assertThreadBlocks(t, Thread.State.WAITING);
181          t.interrupt();
182          awaitTermination(t);
183 <        assertEquals(0, q.remainingCapacity());
183 >        mustEqual(0, q.remainingCapacity());
184      }
185  
186      /**
# Line 190 | Line 188 | public class SynchronousQueueTest extend
188       */
189      public void testTimedOffer() {
190          final boolean fair = randomBoolean();
191 <        final SynchronousQueue q = new SynchronousQueue(fair);
191 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
192          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
193          Thread t = newStartedThread(new CheckedRunnable() {
194              public void realRun() throws InterruptedException {
195                  long startTime = System.nanoTime();
196  
197 <                assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS));
197 >                assertFalse(q.offer(zero, timeoutMillis(), MILLISECONDS));
198                  assertTrue(millisElapsedSince(startTime) >= timeoutMillis());
199  
200                  Thread.currentThread().interrupt();
201                  try {
202 <                    q.offer(new Object(), randomTimeout(), randomTimeUnit());
202 >                    q.offer(one, randomTimeout(), randomTimeUnit());
203                      shouldThrow();
204                  } catch (InterruptedException success) {}
205                  assertFalse(Thread.interrupted());
206  
207                  pleaseInterrupt.countDown();
208                  try {
209 <                    q.offer(new Object(), LONGER_DELAY_MS, MILLISECONDS);
209 >                    q.offer(two, LONGER_DELAY_MS, MILLISECONDS);
210                      shouldThrow();
211                  } catch (InterruptedException success) {}
212                  assertFalse(Thread.interrupted());
# Line 226 | Line 224 | public class SynchronousQueueTest extend
224      public void testPoll()      { testPoll(false); }
225      public void testPoll_fair() { testPoll(true); }
226      public void testPoll(boolean fair) {
227 <        final SynchronousQueue q = new SynchronousQueue(fair);
227 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
228          assertNull(q.poll());
229      }
230  
# Line 236 | Line 234 | public class SynchronousQueueTest extend
234      public void testTimedPoll0()      { testTimedPoll0(false); }
235      public void testTimedPoll0_fair() { testTimedPoll0(true); }
236      public void testTimedPoll0(boolean fair) {
237 <        final SynchronousQueue q = new SynchronousQueue(fair);
237 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
238          try { assertNull(q.poll(0, MILLISECONDS)); }
239          catch (InterruptedException e) { threadUnexpectedException(e); }
240      }
# Line 246 | Line 244 | public class SynchronousQueueTest extend
244       */
245      public void testTimedPoll() {
246          final boolean fair = randomBoolean();
247 <        final SynchronousQueue q = new SynchronousQueue(fair);
247 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
248          final long startTime = System.nanoTime();
249          try { assertNull(q.poll(timeoutMillis(), MILLISECONDS)); }
250          catch (InterruptedException e) { threadUnexpectedException(e); }
# Line 259 | Line 257 | public class SynchronousQueueTest extend
257       */
258      public void testTimedPollWithOffer() {
259          final boolean fair = randomBoolean();
260 <        final SynchronousQueue q = new SynchronousQueue(fair);
260 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
261          final CountDownLatch pleaseOffer = new CountDownLatch(1);
262          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
263          Thread t = newStartedThread(new CheckedRunnable() {
# Line 307 | Line 305 | public class SynchronousQueueTest extend
305      public void testPeek()      { testPeek(false); }
306      public void testPeek_fair() { testPeek(true); }
307      public void testPeek(boolean fair) {
308 <        final SynchronousQueue q = new SynchronousQueue(fair);
308 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
309          assertNull(q.peek());
310      }
311  
# Line 317 | Line 315 | public class SynchronousQueueTest extend
315      public void testElement()      { testElement(false); }
316      public void testElement_fair() { testElement(true); }
317      public void testElement(boolean fair) {
318 <        final SynchronousQueue q = new SynchronousQueue(fair);
318 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
319          try {
320              q.element();
321              shouldThrow();
# Line 330 | Line 328 | public class SynchronousQueueTest extend
328      public void testRemove()      { testRemove(false); }
329      public void testRemove_fair() { testRemove(true); }
330      public void testRemove(boolean fair) {
331 <        final SynchronousQueue q = new SynchronousQueue(fair);
331 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
332          try {
333              q.remove();
334              shouldThrow();
# Line 343 | Line 341 | public class SynchronousQueueTest extend
341      public void testContains()      { testContains(false); }
342      public void testContains_fair() { testContains(true); }
343      public void testContains(boolean fair) {
344 <        final SynchronousQueue q = new SynchronousQueue(fair);
344 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
345          assertFalse(q.contains(zero));
346      }
347  
# Line 353 | Line 351 | public class SynchronousQueueTest extend
351      public void testClear()      { testClear(false); }
352      public void testClear_fair() { testClear(true); }
353      public void testClear(boolean fair) {
354 <        final SynchronousQueue q = new SynchronousQueue(fair);
354 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
355          q.clear();
356          assertTrue(q.isEmpty());
357      }
# Line 364 | Line 362 | public class SynchronousQueueTest extend
362      public void testContainsAll()      { testContainsAll(false); }
363      public void testContainsAll_fair() { testContainsAll(true); }
364      public void testContainsAll(boolean fair) {
365 <        final SynchronousQueue q = new SynchronousQueue(fair);
366 <        Integer[] empty = new Integer[0];
365 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
366 >        Item[] empty = new Item[0];
367          assertTrue(q.containsAll(Arrays.asList(empty)));
368 <        Integer[] ints = new Integer[1]; ints[0] = zero;
369 <        assertFalse(q.containsAll(Arrays.asList(ints)));
368 >        Item[] items = new Item[1]; items[0] = zero;
369 >        assertFalse(q.containsAll(Arrays.asList(items)));
370      }
371  
372      /**
# Line 377 | Line 375 | public class SynchronousQueueTest extend
375      public void testRetainAll()      { testRetainAll(false); }
376      public void testRetainAll_fair() { testRetainAll(true); }
377      public void testRetainAll(boolean fair) {
378 <        final SynchronousQueue q = new SynchronousQueue(fair);
379 <        Integer[] empty = new Integer[0];
378 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
379 >        Item[] empty = new Item[0];
380          assertFalse(q.retainAll(Arrays.asList(empty)));
381 <        Integer[] ints = new Integer[1]; ints[0] = zero;
382 <        assertFalse(q.retainAll(Arrays.asList(ints)));
381 >        Item[] items = new Item[1]; items[0] = zero;
382 >        assertFalse(q.retainAll(Arrays.asList(items)));
383      }
384  
385      /**
# Line 390 | Line 388 | public class SynchronousQueueTest extend
388      public void testRemoveAll()      { testRemoveAll(false); }
389      public void testRemoveAll_fair() { testRemoveAll(true); }
390      public void testRemoveAll(boolean fair) {
391 <        final SynchronousQueue q = new SynchronousQueue(fair);
392 <        Integer[] empty = new Integer[0];
391 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
392 >        Item[] empty = new Item[0];
393          assertFalse(q.removeAll(Arrays.asList(empty)));
394 <        Integer[] ints = new Integer[1]; ints[0] = zero;
395 <        assertFalse(q.containsAll(Arrays.asList(ints)));
394 >        Item[] items = new Item[1]; items[0] = zero;
395 >        assertFalse(q.containsAll(Arrays.asList(items)));
396      }
397  
398      /**
# Line 403 | Line 401 | public class SynchronousQueueTest extend
401      public void testToArray()      { testToArray(false); }
402      public void testToArray_fair() { testToArray(true); }
403      public void testToArray(boolean fair) {
404 <        final SynchronousQueue q = new SynchronousQueue(fair);
404 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
405          Object[] o = q.toArray();
406 <        assertEquals(0, o.length);
406 >        mustEqual(0, o.length);
407      }
408  
409      /**
410 <     * toArray(Integer array) returns its argument with the first
410 >     * toArray(Item array) returns its argument with the first
411       * element (if present) nulled out
412       */
413      public void testToArray2()      { testToArray2(false); }
414      public void testToArray2_fair() { testToArray2(true); }
415      public void testToArray2(boolean fair) {
416 <        final SynchronousQueue<Integer> q = new SynchronousQueue<>(fair);
417 <        Integer[] a;
416 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
417 >        Item[] a;
418  
419 <        a = new Integer[0];
419 >        a = new Item[0];
420          assertSame(a, q.toArray(a));
421  
422 <        a = new Integer[3];
423 <        Arrays.fill(a, 42);
422 >        a = new Item[3];
423 >        Arrays.fill(a, fortytwo);
424          assertSame(a, q.toArray(a));
425          assertNull(a[0]);
426          for (int i = 1; i < a.length; i++)
427 <            assertEquals(42, (int) a[i]);
427 >            mustEqual(42, a[i]);
428      }
429  
430      /**
# Line 435 | Line 433 | public class SynchronousQueueTest extend
433      public void testToArray_null()      { testToArray_null(false); }
434      public void testToArray_null_fair() { testToArray_null(true); }
435      public void testToArray_null(boolean fair) {
436 <        final SynchronousQueue q = new SynchronousQueue(fair);
436 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
437          try {
438              Object[] unused = q.toArray((Object[])null);
439              shouldThrow();
# Line 448 | Line 446 | public class SynchronousQueueTest extend
446      public void testIterator()      { testIterator(false); }
447      public void testIterator_fair() { testIterator(true); }
448      public void testIterator(boolean fair) {
449 <        assertIteratorExhausted(new SynchronousQueue(fair).iterator());
449 >        assertIteratorExhausted(new SynchronousQueue<Item>(fair).iterator());
450      }
451  
452      /**
# Line 457 | Line 455 | public class SynchronousQueueTest extend
455      public void testIteratorRemove()      { testIteratorRemove(false); }
456      public void testIteratorRemove_fair() { testIteratorRemove(true); }
457      public void testIteratorRemove(boolean fair) {
458 <        final SynchronousQueue q = new SynchronousQueue(fair);
459 <        Iterator it = q.iterator();
458 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
459 >        Iterator<? extends Item> it = q.iterator();
460          try {
461              it.remove();
462              shouldThrow();
# Line 471 | Line 469 | public class SynchronousQueueTest extend
469      public void testToString()      { testToString(false); }
470      public void testToString_fair() { testToString(true); }
471      public void testToString(boolean fair) {
472 <        final SynchronousQueue q = new SynchronousQueue(fair);
472 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
473          String s = q.toString();
474          assertNotNull(s);
475      }
# Line 482 | Line 480 | public class SynchronousQueueTest extend
480      public void testOfferInExecutor()      { testOfferInExecutor(false); }
481      public void testOfferInExecutor_fair() { testOfferInExecutor(true); }
482      public void testOfferInExecutor(boolean fair) {
483 <        final SynchronousQueue q = new SynchronousQueue(fair);
483 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
484          final CheckedBarrier threadsStarted = new CheckedBarrier(2);
485          final ExecutorService executor = Executors.newFixedThreadPool(2);
486          try (PoolCleaner cleaner = cleaner(executor)) {
# Line 492 | Line 490 | public class SynchronousQueueTest extend
490                      assertFalse(q.offer(one));
491                      threadsStarted.await();
492                      assertTrue(q.offer(one, LONG_DELAY_MS, MILLISECONDS));
493 <                    assertEquals(0, q.remainingCapacity());
493 >                    mustEqual(0, q.remainingCapacity());
494                  }});
495  
496              executor.execute(new CheckedRunnable() {
# Line 509 | Line 507 | public class SynchronousQueueTest extend
507      public void testPollInExecutor()      { testPollInExecutor(false); }
508      public void testPollInExecutor_fair() { testPollInExecutor(true); }
509      public void testPollInExecutor(boolean fair) {
510 <        final SynchronousQueue q = new SynchronousQueue(fair);
510 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
511          final CheckedBarrier threadsStarted = new CheckedBarrier(2);
512          final ExecutorService executor = Executors.newFixedThreadPool(2);
513          try (PoolCleaner cleaner = cleaner(executor)) {
# Line 533 | Line 531 | public class SynchronousQueueTest extend
531       * a deserialized/reserialized queue is usable
532       */
533      public void testSerialization() {
534 <        final SynchronousQueue x = new SynchronousQueue();
535 <        final SynchronousQueue y = new SynchronousQueue(false);
536 <        final SynchronousQueue z = new SynchronousQueue(true);
534 >        final SynchronousQueue<Item> x = new SynchronousQueue<Item>();
535 >        final SynchronousQueue<Item> y = new SynchronousQueue<Item>(false);
536 >        final SynchronousQueue<Item> z = new SynchronousQueue<Item>(true);
537          assertSerialEquals(x, y);
538          assertNotSerialEquals(x, z);
539 <        SynchronousQueue[] qs = { x, y, z };
540 <        for (SynchronousQueue q : qs) {
541 <            SynchronousQueue clone = serialClone(q);
539 >        SynchronousQueue[] rqs = { x, y, z };
540 >        @SuppressWarnings("unchecked")
541 >        SynchronousQueue<Item>[] qs = (SynchronousQueue<Item>[])rqs;
542 >        for (SynchronousQueue<Item> q : qs) {
543 >            SynchronousQueue<Item> clone = serialClone(q);
544              assertNotSame(q, clone);
545              assertSerialEquals(q, clone);
546              assertTrue(clone.isEmpty());
547 <            assertEquals(0, clone.size());
548 <            assertEquals(0, clone.remainingCapacity());
547 >            mustEqual(0, clone.size());
548 >            mustEqual(0, clone.remainingCapacity());
549              assertFalse(clone.offer(zero));
550          }
551      }
# Line 556 | Line 556 | public class SynchronousQueueTest extend
556      public void testDrainTo()      { testDrainTo(false); }
557      public void testDrainTo_fair() { testDrainTo(true); }
558      public void testDrainTo(boolean fair) {
559 <        final SynchronousQueue q = new SynchronousQueue(fair);
560 <        ArrayList l = new ArrayList();
559 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
560 >        ArrayList<Item> l = new ArrayList<Item>();
561          q.drainTo(l);
562 <        assertEquals(0, q.size());
563 <        assertEquals(0, l.size());
562 >        mustEqual(0, q.size());
563 >        mustEqual(0, l.size());
564      }
565  
566      /**
# Line 569 | Line 569 | public class SynchronousQueueTest extend
569      public void testDrainToWithActivePut()      { testDrainToWithActivePut(false); }
570      public void testDrainToWithActivePut_fair() { testDrainToWithActivePut(true); }
571      public void testDrainToWithActivePut(boolean fair) {
572 <        final SynchronousQueue q = new SynchronousQueue(fair);
572 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>(fair);
573          Thread t = newStartedThread(new CheckedRunnable() {
574              public void realRun() throws InterruptedException {
575                  q.put(one);
576              }});
577  
578 <        ArrayList l = new ArrayList();
578 >        ArrayList<Item> l = new ArrayList<Item>();
579          long startTime = System.nanoTime();
580          while (l.isEmpty()) {
581              q.drainTo(l);
# Line 583 | Line 583 | public class SynchronousQueueTest extend
583                  fail("timed out");
584              Thread.yield();
585          }
586 <        assertEquals(1, l.size());
586 >        mustEqual(1, l.size());
587          assertSame(one, l.get(0));
588          awaitTermination(t);
589      }
# Line 592 | Line 592 | public class SynchronousQueueTest extend
592       * drainTo(c, n) empties up to n elements of queue into c
593       */
594      public void testDrainToN() throws InterruptedException {
595 <        final SynchronousQueue q = new SynchronousQueue();
595 >        final SynchronousQueue<Item> q = new SynchronousQueue<Item>();
596          Thread t1 = newStartedThread(new CheckedRunnable() {
597              public void realRun() throws InterruptedException {
598                  q.put(one);
# Line 603 | Line 603 | public class SynchronousQueueTest extend
603                  q.put(two);
604              }});
605  
606 <        ArrayList l = new ArrayList();
606 >        ArrayList<Item> l = new ArrayList<Item>();
607          int drained;
608          while ((drained = q.drainTo(l, 1)) == 0) Thread.yield();
609 <        assertEquals(1, drained);
610 <        assertEquals(1, l.size());
609 >        mustEqual(1, drained);
610 >        mustEqual(1, l.size());
611          while ((drained = q.drainTo(l, 1)) == 0) Thread.yield();
612 <        assertEquals(1, drained);
613 <        assertEquals(2, l.size());
612 >        mustEqual(1, drained);
613 >        mustEqual(2, l.size());
614          assertTrue(l.contains(one));
615          assertTrue(l.contains(two));
616          awaitTermination(t1);
# Line 621 | Line 621 | public class SynchronousQueueTest extend
621       * remove(null), contains(null) always return false
622       */
623      public void testNeverContainsNull() {
624 <        Collection<?> q = new SynchronousQueue();
624 >        Collection<?> q = new SynchronousQueue<Item>();
625          assertFalse(q.contains(null));
626          assertFalse(q.remove(null));
627      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines