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

Comparing jsr166/src/test/tck/Collection8Test.java (file contents):
Revision 1.9 by jsr166, Thu Nov 3 16:53:13 2016 UTC vs.
Revision 1.10 by jsr166, Sat Nov 5 01:27:00 2016 UTC

# Line 49 | Line 49 | public class Collection8Test extends JSR
49                                        impl);
50      }
51  
52 +    Object bomb() {
53 +        return new Object() {
54 +                public boolean equals(Object x) { throw new AssertionError(); }
55 +                public int hashCode() { throw new AssertionError(); }
56 +            };
57 +    }
58 +
59      /** Checks properties of empty collections. */
60      public void testEmptyMeansEmpty() {
61          Collection c = impl.emptyCollection();
# Line 83 | Line 90 | public class Collection8Test extends JSR
90          assertFalse(c.spliterator().tryAdvance(alwaysThrows));
91          if (c.spliterator().hasCharacteristics(Spliterator.SIZED))
92              assertEquals(0, c.spliterator().estimateSize());
93 +        assertFalse(c.contains(bomb()));
94 +        assertFalse(c.remove(bomb()));
95          if (Queue.class.isAssignableFrom(impl.klazz())) {
96              Queue q = (Queue) c;
97              assertNull(q.peek());
# Line 96 | Line 105 | public class Collection8Test extends JSR
105              assertNull(d.pollLast());
106              assertIteratorExhausted(d.descendingIterator());
107              d.descendingIterator().forEachRemaining(alwaysThrows);
108 +            assertFalse(d.removeFirstOccurrence(bomb()));
109 +            assertFalse(d.removeLastOccurrence(bomb()));
110          }
111      }
112  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines