@Test(expected = NullPointerException.class) public void testInvalidAddFirst() { ArrayDeque arrayDeque = new ArrayDeque(); arrayDeque.addFirst(null); }
public void addFirst(E element) { if (element == null) { throw new NullPointerException(); } head = (head - 1) & (elements.length - 1); elements[head] = element; if (head == tail) { doubleCapacity(); } }
ArrayDeque { public void addFirst(E element) { if (element == null) { throw new NullPointerException(); } head = (head - 1) & (elements.length - 1); elements[head] = element; if (head == tail) { doubleCapacity(); } } }
ArrayDeque { public void addFirst(E element) { if (element == null) { throw new NullPointerException(); } head = (head - 1) & (elements.length - 1); elements[head] = element; if (head == tail) { doubleCapacity(); } } ArrayDeque();  ArrayDeque(int width, int height);  ArrayDeque(int numElements); }
ArrayDeque { public void addFirst(E element) { if (element == null) { throw new NullPointerException(); } head = (head - 1) & (elements.length - 1); elements[head] = element; if (head == tail) { doubleCapacity(); } } ArrayDeque();  ArrayDeque(int width, int height);  ArrayDeque(int numElements); void addFirst(E element); void addLast(E element); E getFirst(); E getLast(); E get(int index); void set(int index, E element); int capacity(); int size(); Object[] toArray(); }
ArrayDeque { public void addFirst(E element) { if (element == null) { throw new NullPointerException(); } head = (head - 1) & (elements.length - 1); elements[head] = element; if (head == tail) { doubleCapacity(); } } ArrayDeque();  ArrayDeque(int width, int height);  ArrayDeque(int numElements); void addFirst(E element); void addLast(E element); E getFirst(); E getLast(); E get(int index); void set(int index, E element); int capacity(); int size(); Object[] toArray();  }