### Question:
ArrayListOfDoubles implements RandomAccess, Cloneable, Iterable<Double> { public void addUnique(int[] arr) { for (int i = 0; i < arr.length; i++) { int elt = arr[i]; if (!contains(elt)) { add(elt); } } } 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 testAddUnique() { ArrayListOfDoubles a = new ArrayListOfDoubles(new double[] { 1, 2, 3, 4, 5, 6, 7 }); a.addUnique(new int[] { 8, 0, 2, 5, -1, 11, 9 }); assertEquals(12, a.size()); assertTrue(Math.abs(0 - a.get(8)) < 0.0001); assertTrue(Math.abs(-1 - a.get(9)) < 0.0001); assertTrue(Math.abs(11 - a.get(10)) < 0.0001); assertTrue(Math.abs(9 - a.get(11)) < 0.0001); }