5 |
|
* http://creativecommons.org/publicdomain/zero/1.0/ |
6 |
|
*/ |
7 |
|
|
8 |
+ |
import static java.util.concurrent.TimeUnit.HOURS; |
9 |
|
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
10 |
|
|
11 |
|
import java.util.ArrayList; |
175 |
|
assertThrows( |
176 |
|
NullPointerException.class, |
177 |
|
() -> { |
178 |
< |
try { q.offer(null, 1L, MILLISECONDS); } |
178 |
> |
try { q.offer(null, 1L, HOURS); } |
179 |
|
catch (InterruptedException ex) { |
180 |
|
throw new AssertionError(ex); |
181 |
|
}}, |
190 |
|
assertThrows( |
191 |
|
NullPointerException.class, |
192 |
|
() -> { |
193 |
< |
try { q.offerFirst(null, 1L, MILLISECONDS); } |
193 |
> |
try { q.offerFirst(null, 1L, HOURS); } |
194 |
|
catch (InterruptedException ex) { |
195 |
|
throw new AssertionError(ex); |
196 |
|
}}, |
197 |
|
() -> { |
198 |
< |
try { q.offerLast(null, 1L, MILLISECONDS); } |
198 |
> |
try { q.offerLast(null, 1L, HOURS); } |
199 |
|
catch (InterruptedException ex) { |
200 |
|
throw new AssertionError(ex); |
201 |
|
}}, |