### Question:
ArrayListOfLongs implements RandomAccess, Cloneable, Iterable<Long> { public ArrayListOfLongs subList(int start, int end) { ArrayListOfLongs sublst = new ArrayListOfLongs(end - start + 1); for (int i = start; i <= end; i++) { sublst.add(get(i)); } return sublst; } ArrayListOfLongs(int initialCapacity);  ArrayListOfLongs();  ArrayListOfLongs(long[] a);  ArrayListOfLongs(int first, int last); void trimToSize(); void ensureCapacity(int minCapacity); int size(); void setSize(int sz); boolean isEmpty(); boolean contains(long n); int indexOf(long n); int lastIndexOf(long n); ArrayListOfLongs clone(); long get(int index); long set(int index, long element); ArrayListOfLongs add(long e); ArrayListOfLongs add(int index, long element); long remove(int index); void clear(); long[] getArray(); Iterator<Long> iterator(); String toString(int n); @Override String toString(); void sort(); ArrayListOfLongs intersection(ArrayListOfLongs other); ArrayListOfLongs merge(ArrayListOfLongs sortedLst); ArrayListOfLongs subList(int start, int end); void addUnique(long[] arr); void shiftLastNToTop(int n); @Override boolean equals(Object obj);  }### Answer:
@Test public void testSubList() { ArrayListOfLongs a = new ArrayListOfLongs(new long[] { 1, 2, 3, 4, 5, 6, 7 }); ArrayListOfLongs 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)); }