### Question:
ArrayList extends List<E> { @Override public boolean addAll(int location, Collection<? extends E> collection) { if (location < 0 || location > itemCount) { throw new ProgrammerError("Index out of bounds; index: {}, size: {}", location, itemCount); } Object[] dumparray = collection.toArray(); int growSize = dumparray.length; if (growSize == 0) { return false; } if (location == 0) { growAtFront(growSize); firstIndex -= growSize; } else if (location == itemCount) { if (firstIndex + itemCount > array.length - growSize) { growAtEnd(growSize); } } else { if (array.length - itemCount < growSize) { growForInsert(location, growSize); } else if (firstIndex + itemCount > array.length - growSize || (firstIndex > 0 && location < itemCount / 2)) { int newFirst = firstIndex - growSize; if (newFirst < 0) { int index = location + firstIndex; SystemUtils.arraycopy(array, index, array, index - newFirst, itemCount - location); newFirst = 0; } SystemUtils.arraycopy(array, firstIndex, array, newFirst, location); firstIndex = newFirst; } else { int index = location + firstIndex; SystemUtils.arraycopy(array, index, array, index + growSize, itemCount - location); } } SystemUtils.arraycopy(dumparray, 0, this.array, location + firstIndex, growSize); itemCount += growSize; modCount++; return true; } ArrayList();  ArrayList(int capacity);  ArrayList(Collection<E> collection);  ArrayList(E... args); @Override void add(int location, E object); @Override boolean add(E object); @Override boolean addAll(int location, Collection<? extends E> collection); @Override boolean addAll(Collection<? extends E> collection); @Override void clear(); @Override boolean contains(E object); void ensureCapacity(int minimumCapacity); @Override E get(int location); @Override int indexOf(E object); @Override boolean isEmpty(); @Override int lastIndexOf(E object); @Override Iterator<E> iterator(); @Override E remove(int location); @Override boolean remove(E object); @Override E set(int location, E object); @Override int size(); @Override Object[] toArray(); @Override void toArray(E[] contents); void sortInPlace(Comparator<E> comparator); void trimToSize();  }### Answer:
@Test public void testAddAll() { ArrayList<String> list = new ArrayList<String>(); list.add("one"); list.add("two"); assertEquals(2, list.size()); list.remove(0); assertEquals(1, list.size()); ArrayList<String> collection = new ArrayList<String>(); collection.add("1"); collection.add("2"); collection.add("3"); assertEquals(3, collection.size()); list.addAll(0, collection); assertEquals(4, list.size()); list.remove(0); list.remove(0); assertEquals(2, list.size()); collection.add("4"); collection.add("5"); collection.add("6"); collection.add("7"); collection.add("8"); collection.add("9"); collection.add("10"); collection.add("11"); collection.add("12"); assertEquals(12, collection.size()); list.addAll(0, collection); assertEquals(14, list.size()); }