### Question:
ArrayListOfShorts implements RandomAccess, Cloneable, Iterable<Short> { public ArrayListOfShorts add(short e) { ensureCapacity(size + 1); array[size++] = e; return this; } ArrayListOfShorts(int initialCapacity);  ArrayListOfShorts();  ArrayListOfShorts(short[] a);  ArrayListOfShorts(short first, short last); void trimToSize(); void ensureCapacity(int minCapacity); int size(); void setSize(int sz); boolean isEmpty(); boolean contains(short n); int indexOf(short n); int lastIndexOf(short n); ArrayListOfShorts clone(); short get(int index); short set(int index, short element); ArrayListOfShorts add(short e); ArrayListOfShorts add(int index, short element); short remove(int index); void clear(); short[] getArray(); Iterator<Short> iterator(); String toString(int n); @Override String toString(); void sort(); ArrayListOfShorts intersection(ArrayListOfShorts other); ArrayListOfShorts merge(ArrayListOfShorts sortedLst); ArrayListOfShorts subList(int start, int end); void addUnique(short[] arr); void shiftLastNToTop(int n); @Override boolean equals(Object obj);  }### Answer:
@Test public void testIterable() { int size = 1000; Random r = new Random(); short[] shorts = new short[size]; ArrayListOfShorts list = new ArrayListOfShorts(); for (int i = 0; i < size; i++) { short k = (short) r.nextInt(size); list.add(k); shorts[i] = k; } int i = 0; for (Short v : list) { assertEquals(shorts[i++], (short) v); } }