### Question:
ArrayList extends List<E> { @Override public int size() { return itemCount; } 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 testConstructorCapacity() { ArrayList<String> al = new ArrayList<String>(5); assertEquals("Incorrect arrayList created", 0, al.size()); al = new ArrayList<String>(0); assertEquals("Incorrect arrayList created", 0, al.size()); try { al = new ArrayList<String>(-1); fail("Should throw exception"); } catch (Throwable t) { } }
@Test public void testSize() { assertEquals("Returned incorrect size for exiting list", 100, alist.size()); assertEquals("Returned incorrect size for new list", 0, new ArrayList<Object>().size()); }