### Question:
ArrayListOfDoubles implements RandomAccess, Cloneable, Iterable<Double> { public ArrayListOfDoubles clone() { return new ArrayListOfDoubles(Arrays.copyOf(array, this.size())); } ArrayListOfDoubles(int initialCapacity);  ArrayListOfDoubles();  ArrayListOfDoubles(double[] a);  ArrayListOfDoubles(int first, int last); void trimToSize(); void ensureCapacity(int minCapacity); int size(); void setSize(int sz); boolean isEmpty(); boolean contains(double n); int indexOf(double n); int lastIndexOf(double n); ArrayListOfDoubles clone(); double get(int index); double set(int index, double element); ArrayListOfDoubles add(double e); ArrayListOfDoubles add(int index, double element); double remove(int index); void clear(); double[] getArray(); Iterator<Double> iterator(); String toString(int n); @Override String toString(); void sort(); ArrayListOfDoubles intersection(ArrayListOfDoubles other); ArrayListOfDoubles merge(ArrayListOfDoubles sortedLst); ArrayListOfDoubles 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(); double[] doubles = new double[size]; ArrayListOfDoubles list1 = new ArrayListOfDoubles(); for (int i = 0; i < size; i++) { double k = r.nextDouble(); list1.add(k); doubles[i] = k; } ArrayListOfDoubles list2 = list1.clone(); assertEquals(size, list1.size()); assertEquals(size, list2.size()); for (int i = 0; i < size; i++) { list2.set(i, doubles[i] + 1); } assertEquals(size, list1.size()); for (int i = 0; i < size; i++) { assertEquals(doubles[i], list1.get(i), 10e-5); } assertEquals(size, list1.size()); for (int i = 0; i < size; i++) { assertEquals(doubles[i] + 1, list2.get(i), 10e-5); } }