List of usage examples for java.util ArrayDeque offerFirst
public boolean offerFirst(E e)
From source file:com.google.gwt.emultest.java.util.ArrayDequeTest.java
public void testOfferFirst() { Object o1 = new Object(); Object o2 = new Object(); Object o3 = new Object(); ArrayDeque<Object> deque = new ArrayDeque<>(); assertTrue(deque.offerFirst(o1)); checkDequeSizeAndContent(deque, o1); assertTrue(deque.offerFirst(o2));/* w w w .j ava2 s . c o m*/ checkDequeSizeAndContent(deque, o2, o1); assertTrue(deque.offerFirst(o3)); checkDequeSizeAndContent(deque, o3, o2, o1); try { deque.offerFirst(null); fail(); } catch (NullPointerException expected) { } }