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