### Question:
ArrayListOfInts implements RandomAccess, Cloneable, Iterable<Integer> { public ArrayListOfInts clone() { return new ArrayListOfInts(Arrays.copyOf(array, this.size())); } 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 testClone() { int size = 100000; Random r = new Random(); int[] ints = new int[size]; ArrayListOfInts list1 = new ArrayListOfInts(); for (int i = 0; i < size; i++) { int k = r.nextInt(size); list1.add(k); ints[i] = k; } ArrayListOfInts list2 = list1.clone(); assertEquals(size, list1.size()); assertEquals(size, list2.size()); for (int i = 0; i < size; i++) { list2.set(i, ints[i] + 1); } assertEquals(size, list1.size()); for (int i = 0; i < size; i++) { assertEquals(ints[i], list1.get(i)); } assertEquals(size, list1.size()); for (int i = 0; i < size; i++) { assertEquals(ints[i] + 1, list2.get(i)); } }