### Question:
ArrayListOfShorts implements RandomAccess, Cloneable, Iterable<Short> { public short remove(int index) { if (index >= size) { throw new ArrayIndexOutOfBoundsException(); } short oldValue = array[index]; int numMoved = size - index - 1; if (numMoved > 0) { System.arraycopy(array, index + 1, array, index, numMoved); } size--; return oldValue; } 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 testArrayConstructor() { short[] arr = new short[] { 1, 2, 3, 4, 5 }; assertEquals(5, arr.length); ArrayListOfShorts list = new ArrayListOfShorts(arr); list.remove(2); assertEquals(1, arr[0]); assertEquals(2, arr[1]); assertEquals(3, arr[2]); assertEquals(4, arr[3]); assertEquals(5, arr[4]); }
@Test public void testRemove() { ArrayListOfShorts list = new ArrayListOfShorts(); for (int i = 0; i < 10; i++) { list.add((short) i); } list.remove(list.indexOf((short) 5)); assertEquals(9, list.size()); assertEquals(0, list.get(0)); assertEquals(1, list.get(1)); assertEquals(2, list.get(2)); assertEquals(3, list.get(3)); assertEquals(4, list.get(4)); assertEquals(6, list.get(5)); assertEquals(7, list.get(6)); assertEquals(8, list.get(7)); assertEquals(9, list.get(8)); list.remove(list.indexOf((short) 9)); assertEquals(8, list.size); assertEquals(0, list.get(0)); assertEquals(1, list.get(1)); assertEquals(2, list.get(2)); assertEquals(3, list.get(3)); assertEquals(4, list.get(4)); assertEquals(6, list.get(5)); assertEquals(7, list.get(6)); assertEquals(8, list.get(7)); }