210 |
|
BlockingQueue q = (BlockingQueue) c; |
211 |
|
assertThrows( |
212 |
|
NullPointerException.class, |
213 |
< |
() -> { |
214 |
< |
try { q.offer(null, 1L, HOURS); } |
215 |
< |
catch (InterruptedException ex) { |
216 |
< |
throw new AssertionError(ex); |
217 |
< |
}}, |
218 |
< |
() -> { |
219 |
< |
try { q.put(null); } |
220 |
< |
catch (InterruptedException ex) { |
221 |
< |
throw new AssertionError(ex); |
222 |
< |
}}); |
213 |
> |
() -> q.offer(null, 1L, HOURS), |
214 |
> |
() -> q.put(null)); |
215 |
|
} |
216 |
|
if (c instanceof BlockingDeque) { |
217 |
|
BlockingDeque q = (BlockingDeque) c; |
218 |
|
assertThrows( |
219 |
|
NullPointerException.class, |
220 |
< |
() -> { |
221 |
< |
try { q.offerFirst(null, 1L, HOURS); } |
222 |
< |
catch (InterruptedException ex) { |
223 |
< |
throw new AssertionError(ex); |
232 |
< |
}}, |
233 |
< |
() -> { |
234 |
< |
try { q.offerLast(null, 1L, HOURS); } |
235 |
< |
catch (InterruptedException ex) { |
236 |
< |
throw new AssertionError(ex); |
237 |
< |
}}, |
238 |
< |
() -> { |
239 |
< |
try { q.putFirst(null); } |
240 |
< |
catch (InterruptedException ex) { |
241 |
< |
throw new AssertionError(ex); |
242 |
< |
}}, |
243 |
< |
() -> { |
244 |
< |
try { q.putLast(null); } |
245 |
< |
catch (InterruptedException ex) { |
246 |
< |
throw new AssertionError(ex); |
247 |
< |
}}); |
220 |
> |
() -> q.offerFirst(null, 1L, HOURS), |
221 |
> |
() -> q.offerLast(null, 1L, HOURS), |
222 |
> |
() -> q.putFirst(null), |
223 |
> |
() -> q.putLast(null)); |
224 |
|
} |
225 |
|
} |
226 |
|
|