169 |
|
q.getFirst(); |
170 |
|
shouldThrow(); |
171 |
|
} catch (NoSuchElementException success) {} |
172 |
+ |
assertNull(q.peekFirst()); |
173 |
|
} |
174 |
|
|
175 |
|
/** |
200 |
|
q.removeFirst(); |
201 |
|
shouldThrow(); |
202 |
|
} catch (NoSuchElementException success) {} |
203 |
+ |
assertNull(q.peekFirst()); |
204 |
+ |
} |
205 |
+ |
|
206 |
+ |
/** |
207 |
+ |
* removeLast removes last element, or throws NSEE if empty |
208 |
+ |
*/ |
209 |
+ |
public void testRemoveLast() { |
210 |
+ |
LinkedBlockingDeque q = populatedDeque(SIZE); |
211 |
+ |
for (int i = SIZE - 1; i >= 0; --i) { |
212 |
+ |
assertEquals(i, ((Integer)q.removeLast()).intValue()); |
213 |
+ |
} |
214 |
+ |
try { |
215 |
+ |
q.removeLast(); |
216 |
+ |
shouldThrow(); |
217 |
+ |
} catch (NoSuchElementException success) {} |
218 |
+ |
assertNull(q.peekLast()); |
219 |
|
} |
220 |
|
|
221 |
|
/** |