@Test(expected = IndexOutOfBoundsException.class) public void testInvalidGet() { ArrayDeque arrayDeque = new ArrayDeque(); arrayDeque.get(1); }
public E get(int index) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException("Attempted to get " + index + " but size " + size()); } return elements[(head + index) % elements.length]; }
ArrayDeque { public E get(int index) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException("Attempted to get " + index + " but size " + size()); } return elements[(head + index) % elements.length]; } }
ArrayDeque { public E get(int index) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException("Attempted to get " + index + " but size " + size()); } return elements[(head + index) % elements.length]; } ArrayDeque();  ArrayDeque(int width, int height);  ArrayDeque(int numElements); }
ArrayDeque { public E get(int index) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException("Attempted to get " + index + " but size " + size()); } return elements[(head + index) % elements.length]; } 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 E get(int index) { if (index < 0 || index >= size()) { throw new IndexOutOfBoundsException("Attempted to get " + index + " but size " + size()); } return elements[(head + index) % elements.length]; } 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();  }