### Question:
ArrayListOfShorts implements RandomAccess, Cloneable, Iterable<Short> { public ArrayListOfShorts subList(int start, int end) { ArrayListOfShorts sublst = new ArrayListOfShorts(end - start + 1); for (int i = start; i <= end; i++) { sublst.add(get(i)); } return sublst; } 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 testSubList() { ArrayListOfShorts a = new ArrayListOfShorts(new short[] { 1, 2, 3, 4, 5, 6, 7 }); ArrayListOfShorts b = a.subList(1, 5); assertEquals(5, b.size()); assertEquals(2, b.get(0)); assertEquals(3, b.get(1)); assertEquals(4, b.get(2)); assertEquals(5, b.get(3)); assertEquals(6, b.get(4)); a.clear(); assertEquals(5, b.size()); assertEquals(2, b.get(0)); assertEquals(3, b.get(1)); assertEquals(4, b.get(2)); assertEquals(5, b.get(3)); assertEquals(6, b.get(4)); }