### Question:
ArrayListOfInts implements RandomAccess, Cloneable, Iterable<Integer> { public void sort() { trimToSize(); Arrays.sort(getArray()); } ArrayListOfInts(int initialCapacity);  ArrayListOfInts();  ArrayListOfInts(int[] a);  ArrayListOfInts(int first, int last); void trimToSize(); void ensureCapacity(int minCapacity); int size(); void setSize(int sz); boolean isEmpty(); boolean contains(int n); int indexOf(int n); int lastIndexOf(int n); ArrayListOfInts clone(); int get(int index); int set(int index, int element); ArrayListOfInts add(int e); ArrayListOfInts add(int index, int element); int remove(int index); void clear(); int[] getArray(); Iterator<Integer> iterator(); String toString(int n); @Override String toString(); void sort(); ArrayListOfInts intersection(ArrayListOfInts other); ArrayListOfInts merge(ArrayListOfInts sortedLst); ArrayListOfInts mergeNoDuplicates(ArrayListOfInts sortedLst); ArrayListOfInts subList(int start, int end); void addUnique(int[] arr); void shiftLastNToTop(int n); @Override boolean equals(Object obj);  }### Answer:
@Test public void testSort() { ArrayListOfInts a = new ArrayListOfInts(); assertEquals(0, a.size()); a.add(5).add(6).add(1).add(4); assertEquals(4, a.size()); a.sort(); assertEquals(4, a.size()); assertEquals(1, a.get(0)); assertEquals(4, a.get(1)); assertEquals(5, a.get(2)); assertEquals(6, a.get(3)); }