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

Comparing jsr166/src/test/tck/ConcurrentLinkedQueueTest.java (file contents):
Revision 1.4 by dl, Sat Sep 20 18:20:07 2003 UTC vs.
Revision 1.49 by jsr166, Fri Jun 22 00:04:58 2018 UTC

# Line 1 | Line 1
1   /*
2 < * Written by members of JCP JSR-166 Expert Group and released to the
3 < * public domain. Use, modify, and redistribute this code in any way
4 < * without acknowledgement. Other contributors include Andrew Wright,
5 < * Jeffrey Hayes, Pat Fischer, Mike Judd.
2 > * Written by Doug Lea with assistance from members of JCP JSR-166
3 > * Expert Group and released to the public domain, as explained at
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5 > * Other contributors include Andrew Wright, Jeffrey Hayes,
6 > * Pat Fisher, Mike Judd.
7   */
8  
9 < import junit.framework.*;
10 < import java.util.*;
11 < import java.util.concurrent.*;
12 < import java.io.*;
9 > import java.util.Arrays;
10 > import java.util.Collection;
11 > import java.util.Iterator;
12 > import java.util.NoSuchElementException;
13 > import java.util.Queue;
14 > import java.util.concurrent.ConcurrentLinkedQueue;
15 >
16 > import junit.framework.Test;
17  
18   public class ConcurrentLinkedQueueTest extends JSR166TestCase {
19  
20      public static void main(String[] args) {
21 <        junit.textui.TestRunner.run (suite());  
21 >        main(suite(), args);
22      }
23  
24      public static Test suite() {
25 <        return new TestSuite(ConcurrentLinkedQueueTest.class);
25 >        class Implementation implements CollectionImplementation {
26 >            public Class<?> klazz() { return ConcurrentLinkedQueue.class; }
27 >            public Collection emptyCollection() { return new ConcurrentLinkedQueue(); }
28 >            public Object makeElement(int i) { return i; }
29 >            public boolean isConcurrent() { return true; }
30 >            public boolean permitsNulls() { return false; }
31 >        }
32 >        return newTestSuite(ConcurrentLinkedQueueTest.class,
33 >                            CollectionTest.testSuite(new Implementation()));
34      }
35  
36      /**
37 <     * Create a queue of given size containing consecutive
38 <     * Integers 0 ... n.
37 >     * Returns a new queue of given size containing consecutive
38 >     * Integers 0 ... n - 1.
39       */
40 <    private ConcurrentLinkedQueue populatedQueue(int n) {
41 <        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
40 >    private static ConcurrentLinkedQueue<Integer> populatedQueue(int n) {
41 >        ConcurrentLinkedQueue<Integer> q = new ConcurrentLinkedQueue<>();
42          assertTrue(q.isEmpty());
43 <        for(int i = 0; i < n; ++i)
44 <            assertTrue(q.offer(new Integer(i)));
43 >        for (int i = 0; i < n; ++i)
44 >            assertTrue(q.offer(new Integer(i)));
45          assertFalse(q.isEmpty());
46 <        assertEquals(n, q.size());
46 >        assertEquals(n, q.size());
47 >        assertEquals((Integer) 0, q.peek());
48          return q;
49      }
50 <
50 >
51      /**
52 <     *
52 >     * new queue is empty
53       */
54      public void testConstructor1() {
55          assertEquals(0, new ConcurrentLinkedQueue().size());
56      }
57  
58      /**
59 <     *
59 >     * Initializing from null Collection throws NPE
60       */
61      public void testConstructor3() {
62          try {
63 <            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue((Collection)null);
63 >            new ConcurrentLinkedQueue((Collection)null);
64              shouldThrow();
65 <        }
52 <        catch (NullPointerException success) {}
65 >        } catch (NullPointerException success) {}
66      }
67  
68      /**
69 <     *
69 >     * Initializing from Collection of null elements throws NPE
70       */
71      public void testConstructor4() {
72          try {
73 <            Integer[] ints = new Integer[SIZE];
61 <            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(Arrays.asList(ints));
73 >            new ConcurrentLinkedQueue(Arrays.asList(new Integer[SIZE]));
74              shouldThrow();
75 <        }
64 <        catch (NullPointerException success) {}
75 >        } catch (NullPointerException success) {}
76      }
77  
78      /**
79 <     *
79 >     * Initializing from Collection with some null elements throws NPE
80       */
81      public void testConstructor5() {
82 +        Integer[] ints = new Integer[SIZE];
83 +        for (int i = 0; i < SIZE - 1; ++i)
84 +            ints[i] = new Integer(i);
85          try {
86 <            Integer[] ints = new Integer[SIZE];
73 <            for (int i = 0; i < SIZE-1; ++i)
74 <                ints[i] = new Integer(i);
75 <            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(Arrays.asList(ints));
86 >            new ConcurrentLinkedQueue(Arrays.asList(ints));
87              shouldThrow();
88 <        }
78 <        catch (NullPointerException success) {}
88 >        } catch (NullPointerException success) {}
89      }
90  
91      /**
92 <     *
92 >     * Queue contains all elements of collection used to initialize
93       */
94      public void testConstructor6() {
95 <        try {
96 <            Integer[] ints = new Integer[SIZE];
97 <            for (int i = 0; i < SIZE; ++i)
98 <                ints[i] = new Integer(i);
99 <            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(Arrays.asList(ints));
100 <            for (int i = 0; i < SIZE; ++i)
91 <                assertEquals(ints[i], q.poll());
92 <        }
93 <        finally {}
95 >        Integer[] ints = new Integer[SIZE];
96 >        for (int i = 0; i < SIZE; ++i)
97 >            ints[i] = new Integer(i);
98 >        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(Arrays.asList(ints));
99 >        for (int i = 0; i < SIZE; ++i)
100 >            assertEquals(ints[i], q.poll());
101      }
102  
103      /**
104 <     *
104 >     * isEmpty is true before add, false after
105       */
106      public void testEmpty() {
107          ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
# Line 108 | Line 115 | public class ConcurrentLinkedQueueTest e
115      }
116  
117      /**
118 <     *
118 >     * size changes when elements added and removed
119       */
120      public void testSize() {
121          ConcurrentLinkedQueue q = populatedQueue(SIZE);
122          for (int i = 0; i < SIZE; ++i) {
123 <            assertEquals(SIZE-i, q.size());
123 >            assertEquals(SIZE - i, q.size());
124              q.remove();
125          }
126          for (int i = 0; i < SIZE; ++i) {
# Line 123 | Line 130 | public class ConcurrentLinkedQueueTest e
130      }
131  
132      /**
133 <     *
133 >     * offer(null) throws NPE
134       */
135      public void testOfferNull() {
136 <        try {
137 <            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
136 >        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
137 >        try {
138              q.offer(null);
139              shouldThrow();
140 <        } catch (NullPointerException success) { }  
140 >        } catch (NullPointerException success) {}
141 >    }
142 >
143 >    /**
144 >     * add(null) throws NPE
145 >     */
146 >    public void testAddNull() {
147 >        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
148 >        try {
149 >            q.add(null);
150 >            shouldThrow();
151 >        } catch (NullPointerException success) {}
152      }
153  
154      /**
155 <     *
155 >     * Offer returns true
156       */
157      public void testOffer() {
158          ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
# Line 143 | Line 161 | public class ConcurrentLinkedQueueTest e
161      }
162  
163      /**
164 <     *
164 >     * add returns true
165       */
166      public void testAdd() {
167          ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
# Line 154 | Line 172 | public class ConcurrentLinkedQueueTest e
172      }
173  
174      /**
175 <     *
175 >     * addAll(null) throws NullPointerException
176       */
177      public void testAddAll1() {
178 +        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
179          try {
161            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
180              q.addAll(null);
181              shouldThrow();
182 <        }
165 <        catch (NullPointerException success) {}
182 >        } catch (NullPointerException success) {}
183      }
184 +
185 +    /**
186 +     * addAll(this) throws IllegalArgumentException
187 +     */
188 +    public void testAddAllSelf() {
189 +        ConcurrentLinkedQueue q = populatedQueue(SIZE);
190 +        try {
191 +            q.addAll(q);
192 +            shouldThrow();
193 +        } catch (IllegalArgumentException success) {}
194 +    }
195 +
196      /**
197 <     *
197 >     * addAll of a collection with null elements throws NullPointerException
198       */
199      public void testAddAll2() {
200 +        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
201          try {
202 <            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
173 <            Integer[] ints = new Integer[SIZE];
174 <            q.addAll(Arrays.asList(ints));
202 >            q.addAll(Arrays.asList(new Integer[SIZE]));
203              shouldThrow();
204 <        }
177 <        catch (NullPointerException success) {}
204 >        } catch (NullPointerException success) {}
205      }
206 +
207      /**
208 <     *
208 >     * addAll of a collection with any null elements throws NPE after
209 >     * possibly adding some elements
210       */
211      public void testAddAll3() {
212 +        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
213 +        Integer[] ints = new Integer[SIZE];
214 +        for (int i = 0; i < SIZE - 1; ++i)
215 +            ints[i] = new Integer(i);
216          try {
184            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
185            Integer[] ints = new Integer[SIZE];
186            for (int i = 0; i < SIZE-1; ++i)
187                ints[i] = new Integer(i);
217              q.addAll(Arrays.asList(ints));
218              shouldThrow();
219 <        }
191 <        catch (NullPointerException success) {}
219 >        } catch (NullPointerException success) {}
220      }
221  
222      /**
223 <     *
223 >     * Queue contains all elements, in traversal order, of successful addAll
224       */
225      public void testAddAll5() {
226 <        try {
227 <            Integer[] empty = new Integer[0];
228 <            Integer[] ints = new Integer[SIZE];
229 <            for (int i = 0; i < SIZE; ++i)
230 <                ints[i] = new Integer(i);
231 <            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
232 <            assertFalse(q.addAll(Arrays.asList(empty)));
233 <            assertTrue(q.addAll(Arrays.asList(ints)));
234 <            for (int i = 0; i < SIZE; ++i)
207 <                assertEquals(ints[i], q.poll());
208 <        }
209 <        finally {}
226 >        Integer[] empty = new Integer[0];
227 >        Integer[] ints = new Integer[SIZE];
228 >        for (int i = 0; i < SIZE; ++i)
229 >            ints[i] = new Integer(i);
230 >        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
231 >        assertFalse(q.addAll(Arrays.asList(empty)));
232 >        assertTrue(q.addAll(Arrays.asList(ints)));
233 >        for (int i = 0; i < SIZE; ++i)
234 >            assertEquals(ints[i], q.poll());
235      }
236  
237      /**
238 <     *
238 >     * poll succeeds unless empty
239       */
240      public void testPoll() {
241          ConcurrentLinkedQueue q = populatedQueue(SIZE);
242          for (int i = 0; i < SIZE; ++i) {
243 <            assertEquals(i, ((Integer)q.poll()).intValue());
243 >            assertEquals(i, q.poll());
244          }
245 <        assertNull(q.poll());
245 >        assertNull(q.poll());
246      }
247  
248      /**
249 <     *
249 >     * peek returns next element, or null if empty
250       */
251      public void testPeek() {
252          ConcurrentLinkedQueue q = populatedQueue(SIZE);
253          for (int i = 0; i < SIZE; ++i) {
254 <            assertEquals(i, ((Integer)q.peek()).intValue());
255 <            q.poll();
254 >            assertEquals(i, q.peek());
255 >            assertEquals(i, q.poll());
256              assertTrue(q.peek() == null ||
257 <                       i != ((Integer)q.peek()).intValue());
257 >                       !q.peek().equals(i));
258          }
259 <        assertNull(q.peek());
259 >        assertNull(q.peek());
260      }
261  
262      /**
263 <     *
263 >     * element returns next element, or throws NSEE if empty
264       */
265      public void testElement() {
266          ConcurrentLinkedQueue q = populatedQueue(SIZE);
267          for (int i = 0; i < SIZE; ++i) {
268 <            assertEquals(i, ((Integer)q.element()).intValue());
269 <            q.poll();
268 >            assertEquals(i, q.element());
269 >            assertEquals(i, q.poll());
270          }
271          try {
272              q.element();
273              shouldThrow();
274 <        }
250 <        catch (NoSuchElementException success) {}
274 >        } catch (NoSuchElementException success) {}
275      }
276  
277      /**
278 <     *
278 >     * remove removes next element, or throws NSEE if empty
279       */
280      public void testRemove() {
281          ConcurrentLinkedQueue q = populatedQueue(SIZE);
282          for (int i = 0; i < SIZE; ++i) {
283 <            assertEquals(i, ((Integer)q.remove()).intValue());
283 >            assertEquals(i, q.remove());
284          }
285          try {
286              q.remove();
287              shouldThrow();
288 <        } catch (NoSuchElementException success){
265 <        }  
288 >        } catch (NoSuchElementException success) {}
289      }
290  
291      /**
292 <     *
292 >     * remove(x) removes x and returns true if present
293       */
294      public void testRemoveElement() {
295          ConcurrentLinkedQueue q = populatedQueue(SIZE);
296 <        for (int i = 1; i < SIZE; i+=2) {
297 <            assertTrue(q.remove(new Integer(i)));
298 <        }
299 <        for (int i = 0; i < SIZE; i+=2) {
300 <            assertTrue(q.remove(new Integer(i)));
301 <            assertFalse(q.remove(new Integer(i+1)));
296 >        for (int i = 1; i < SIZE; i += 2) {
297 >            assertTrue(q.contains(i));
298 >            assertTrue(q.remove(i));
299 >            assertFalse(q.contains(i));
300 >            assertTrue(q.contains(i - 1));
301 >        }
302 >        for (int i = 0; i < SIZE; i += 2) {
303 >            assertTrue(q.contains(i));
304 >            assertTrue(q.remove(i));
305 >            assertFalse(q.contains(i));
306 >            assertFalse(q.remove(i + 1));
307 >            assertFalse(q.contains(i + 1));
308          }
309          assertTrue(q.isEmpty());
310      }
311 <        
311 >
312      /**
313 <     *
313 >     * contains(x) reports true when elements added but not yet removed
314       */
315      public void testContains() {
316          ConcurrentLinkedQueue q = populatedQueue(SIZE);
# Line 293 | Line 322 | public class ConcurrentLinkedQueueTest e
322      }
323  
324      /**
325 <     *
325 >     * clear removes all elements
326       */
327      public void testClear() {
328          ConcurrentLinkedQueue q = populatedQueue(SIZE);
# Line 307 | Line 336 | public class ConcurrentLinkedQueueTest e
336      }
337  
338      /**
339 <     *
339 >     * containsAll(c) is true when c contains a subset of elements
340       */
341      public void testContainsAll() {
342          ConcurrentLinkedQueue q = populatedQueue(SIZE);
# Line 321 | Line 350 | public class ConcurrentLinkedQueueTest e
350      }
351  
352      /**
353 <     *
353 >     * retainAll(c) retains only those elements of c and reports true if change
354       */
355      public void testRetainAll() {
356          ConcurrentLinkedQueue q = populatedQueue(SIZE);
# Line 334 | Line 363 | public class ConcurrentLinkedQueueTest e
363                  assertTrue(changed);
364  
365              assertTrue(q.containsAll(p));
366 <            assertEquals(SIZE-i, q.size());
366 >            assertEquals(SIZE - i, q.size());
367              p.remove();
368          }
369      }
370  
371      /**
372 <     *
372 >     * removeAll(c) removes only those elements of c and reports true if changed
373       */
374      public void testRemoveAll() {
375          for (int i = 1; i < SIZE; ++i) {
376              ConcurrentLinkedQueue q = populatedQueue(SIZE);
377              ConcurrentLinkedQueue p = populatedQueue(i);
378              assertTrue(q.removeAll(p));
379 <            assertEquals(SIZE-i, q.size());
379 >            assertEquals(SIZE - i, q.size());
380              for (int j = 0; j < i; ++j) {
381 <                Integer I = (Integer)(p.remove());
382 <                assertFalse(q.contains(I));
381 >                Integer x = (Integer)(p.remove());
382 >                assertFalse(q.contains(x));
383              }
384          }
385      }
386  
387      /**
388 <     *
388 >     * toArray contains all elements in FIFO order
389       */
390      public void testToArray() {
391          ConcurrentLinkedQueue q = populatedQueue(SIZE);
392 <        Object[] o = q.toArray();
393 <        Arrays.sort(o);
394 <        for(int i = 0; i < o.length; i++)
395 <            assertEquals(o[i], q.poll());
392 >        Object[] a = q.toArray();
393 >        assertSame(Object[].class, a.getClass());
394 >        for (Object o : a)
395 >            assertSame(o, q.poll());
396 >        assertTrue(q.isEmpty());
397      }
398  
399      /**
400 <     *
400 >     * toArray(a) contains all elements in FIFO order
401       */
402      public void testToArray2() {
403 +        ConcurrentLinkedQueue<Integer> q = populatedQueue(SIZE);
404 +        Integer[] ints = new Integer[SIZE];
405 +        Integer[] array = q.toArray(ints);
406 +        assertSame(ints, array);
407 +        for (Integer o : ints)
408 +            assertSame(o, q.poll());
409 +        assertTrue(q.isEmpty());
410 +    }
411 +
412 +    /**
413 +     * toArray(null) throws NullPointerException
414 +     */
415 +    public void testToArray_NullArg() {
416          ConcurrentLinkedQueue q = populatedQueue(SIZE);
417 <        Integer[] ints = new Integer[SIZE];
418 <        ints = (Integer[])q.toArray(ints);
419 <        Arrays.sort(ints);
420 <        for(int i = 0; i < ints.length; i++)
421 <            assertEquals(ints[i], q.poll());
417 >        try {
418 >            q.toArray((Object[])null);
419 >            shouldThrow();
420 >        } catch (NullPointerException success) {}
421 >    }
422 >
423 >    /**
424 >     * toArray(incompatible array type) throws ArrayStoreException
425 >     */
426 >    public void testToArray1_BadArg() {
427 >        ConcurrentLinkedQueue q = populatedQueue(SIZE);
428 >        try {
429 >            q.toArray(new String[10]);
430 >            shouldThrow();
431 >        } catch (ArrayStoreException success) {}
432      }
433 <    
433 >
434      /**
435 <     *
435 >     * iterator iterates through all elements
436       */
437      public void testIterator() {
438          ConcurrentLinkedQueue q = populatedQueue(SIZE);
439 <        int i = 0;
440 <        Iterator it = q.iterator();
441 <        while(it.hasNext()) {
439 >        Iterator it = q.iterator();
440 >        int i;
441 >        for (i = 0; it.hasNext(); i++)
442              assertTrue(q.contains(it.next()));
390            ++i;
391        }
443          assertEquals(i, SIZE);
444 +        assertIteratorExhausted(it);
445 +    }
446 +
447 +    /**
448 +     * iterator of empty collection has no elements
449 +     */
450 +    public void testEmptyIterator() {
451 +        assertIteratorExhausted(new ConcurrentLinkedQueue().iterator());
452      }
453  
454      /**
455 <     *
455 >     * iterator ordering is FIFO
456       */
457      public void testIteratorOrdering() {
458          final ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
# Line 403 | Line 462 | public class ConcurrentLinkedQueueTest e
462  
463          int k = 0;
464          for (Iterator it = q.iterator(); it.hasNext();) {
465 <            int i = ((Integer)(it.next())).intValue();
407 <            assertEquals(++k, i);
465 >            assertEquals(++k, it.next());
466          }
467  
468          assertEquals(3, k);
469      }
470  
471      /**
472 <     *
472 >     * Modifications do not cause iterators to fail
473       */
474 <    public void testWeaklyConsistentIteration () {
474 >    public void testWeaklyConsistentIteration() {
475          final ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
476          q.add(one);
477          q.add(two);
478          q.add(three);
479  
480 <        try {
481 <            for (Iterator it = q.iterator(); it.hasNext();) {
482 <                q.remove();
425 <                it.next();
426 <            }
427 <        }
428 <        catch (ConcurrentModificationException e) {
429 <            shouldThrow();
480 >        for (Iterator it = q.iterator(); it.hasNext();) {
481 >            q.remove();
482 >            it.next();
483          }
484  
485          assertEquals("queue should be empty again", 0, q.size());
486      }
487  
488      /**
489 <     *
489 >     * iterator.remove removes current element
490       */
491 <    public void testIteratorRemove () {
491 >    public void testIteratorRemove() {
492          final ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
493          q.add(one);
494          q.add(two);
# Line 444 | Line 497 | public class ConcurrentLinkedQueueTest e
497          it.next();
498          it.remove();
499          it = q.iterator();
500 <        assertEquals(it.next(), two);
501 <        assertEquals(it.next(), three);
500 >        assertSame(it.next(), two);
501 >        assertSame(it.next(), three);
502          assertFalse(it.hasNext());
503      }
504  
452
505      /**
506 <     *
506 >     * toString contains toStrings of elements
507       */
508      public void testToString() {
509          ConcurrentLinkedQueue q = populatedQueue(SIZE);
510          String s = q.toString();
511          for (int i = 0; i < SIZE; ++i) {
512 <            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
512 >            assertTrue(s.contains(String.valueOf(i)));
513          }
514 <    }        
514 >    }
515  
516      /**
517 <     *
517 >     * A deserialized/reserialized queue has same elements in same order
518       */
519 <    public void testSerialization() {
520 <        ConcurrentLinkedQueue q = populatedQueue(SIZE);
521 <        try {
470 <            ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
471 <            ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
472 <            out.writeObject(q);
473 <            out.close();
519 >    public void testSerialization() throws Exception {
520 >        Queue x = populatedQueue(SIZE);
521 >        Queue y = serialClone(x);
522  
523 <            ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
524 <            ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
525 <            ConcurrentLinkedQueue r = (ConcurrentLinkedQueue)in.readObject();
526 <            assertEquals(q.size(), r.size());
527 <            while (!q.isEmpty())
528 <                assertEquals(q.remove(), r.remove());
529 <        } catch(Exception e){
482 <            unexpectedException();
523 >        assertNotSame(x, y);
524 >        assertEquals(x.size(), y.size());
525 >        assertEquals(x.toString(), y.toString());
526 >        assertTrue(Arrays.equals(x.toArray(), y.toArray()));
527 >        while (!x.isEmpty()) {
528 >            assertFalse(y.isEmpty());
529 >            assertEquals(x.remove(), y.remove());
530          }
531 +        assertTrue(y.isEmpty());
532      }
533  
534 +    /**
535 +     * remove(null), contains(null) always return false
536 +     */
537 +    public void testNeverContainsNull() {
538 +        Collection<?>[] qs = {
539 +            new ConcurrentLinkedQueue<Object>(),
540 +            populatedQueue(2),
541 +        };
542 +
543 +        for (Collection<?> q : qs) {
544 +            assertFalse(q.contains(null));
545 +            assertFalse(q.remove(null));
546 +        }
547 +    }
548   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines