### Question:
ArrayListOfDoubles implements RandomAccess, Cloneable, Iterable<Double> { public void setSize(int sz) { ensureCapacity(sz); size = sz; } 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 testSetSize() { ArrayListOfDoubles list = new ArrayListOfDoubles(); list.add(5); assertEquals(1, list.size); assertEquals(5, list.get(0), 10e-6); list.setSize(5); assertEquals(5, list.size); assertEquals(0, list.get(1), 10e-6); assertEquals(0, list.get(2), 10e-6); assertEquals(0, list.get(3), 10e-6); assertEquals(0, list.get(4), 10e-6); list.add(12); assertEquals(6, list.size); assertEquals(12, list.get(5), 10e-6); }