105 |
|
() -> c.retainAll(null), |
106 |
|
() -> c.removeAll(null), |
107 |
|
() -> c.removeIf(null), |
108 |
+ |
() -> c.forEach(null), |
109 |
+ |
() -> c.iterator().forEachRemaining(null), |
110 |
+ |
() -> c.spliterator().forEachRemaining(null), |
111 |
+ |
() -> c.spliterator().tryAdvance(null), |
112 |
|
() -> c.toArray(null)); |
113 |
|
|
114 |
|
if (!impl.permitsNulls()) { |
132 |
|
() -> d.addLast(null), |
133 |
|
() -> d.offerFirst(null), |
134 |
|
() -> d.offerLast(null), |
135 |
< |
() -> d.push(null)); |
135 |
> |
() -> d.push(null), |
136 |
> |
() -> d.descendingIterator().forEachRemaining(null)); |
137 |
|
} |
138 |
|
} |
139 |
|
|
182 |
|
} |
183 |
|
}; |
184 |
|
try { |
185 |
< |
boolean modified = c.removeIf(randomPredicate); |
186 |
< |
if (!modified) { |
187 |
< |
assertNull(threwAt.get()); |
188 |
< |
assertEquals(n, rejects.size()); |
189 |
< |
assertEquals(0, accepts.size()); |
190 |
< |
} |
191 |
< |
} catch (ArithmeticException ok) {} |
192 |
< |
survivors.removeAll(accepts); |
193 |
< |
if (n - accepts.size() != c.size()) { |
185 |
> |
assertFalse(survivors.contains(null)); |
186 |
> |
try { |
187 |
> |
boolean modified = c.removeIf(randomPredicate); |
188 |
> |
if (!modified) { |
189 |
> |
assertNull(threwAt.get()); |
190 |
> |
assertEquals(n, rejects.size()); |
191 |
> |
assertEquals(0, accepts.size()); |
192 |
> |
} |
193 |
> |
} catch (ArithmeticException ok) {} |
194 |
> |
survivors.removeAll(accepts); |
195 |
> |
assertEquals(n - accepts.size(), c.size()); |
196 |
> |
assertTrue(c.containsAll(survivors)); |
197 |
> |
assertTrue(survivors.containsAll(rejects)); |
198 |
> |
for (Object x : accepts) assertFalse(c.contains(x)); |
199 |
> |
if (threwAt.get() == null) |
200 |
> |
assertEquals(accepts.size() + rejects.size(), n); |
201 |
> |
} catch (Throwable ex) { |
202 |
|
System.err.println(impl.klazz()); |
203 |
< |
System.err.println(c); |
204 |
< |
System.err.println(accepts); |
205 |
< |
System.err.println(rejects); |
206 |
< |
System.err.println(survivors); |
207 |
< |
System.err.println(threwAt.get()); |
208 |
< |
} |
209 |
< |
assertEquals(n - accepts.size(), c.size()); |
210 |
< |
assertTrue(c.containsAll(survivors)); |
198 |
< |
assertTrue(survivors.containsAll(rejects)); |
199 |
< |
for (Object x : accepts) assertFalse(c.contains(x)); |
200 |
< |
if (threwAt.get() == null) |
201 |
< |
assertEquals(accepts.size() + rejects.size(), n); |
203 |
> |
System.err.printf("c=%s%n", c); |
204 |
> |
System.err.printf("n=%d%n", n); |
205 |
> |
System.err.printf("accepts=%s%n", accepts); |
206 |
> |
System.err.printf("rejects=%s%n", rejects); |
207 |
> |
System.err.printf("survivors=%s%n", survivors); |
208 |
> |
System.err.printf("threw=%s%n", threwAt.get()); |
209 |
> |
throw ex; |
210 |
> |
} |
211 |
|
} |
212 |
|
|
213 |
|
/** |