### Question:
ArrayListOfFloats implements RandomAccess, Cloneable, Iterable<Float> { public float remove(int index) { if (index >= size) { throw new ArrayIndexOutOfBoundsException(); } float oldValue = array[index]; int numMoved = size - index - 1; if (numMoved > 0) { System.arraycopy(array, index + 1, array, index, numMoved); } size--; return oldValue; } ArrayListOfFloats(int initialCapacity);  ArrayListOfFloats();  ArrayListOfFloats(float[] a);  ArrayListOfFloats(int first, int last); void trimToSize(); void ensureCapacity(int minCapacity); int size(); void setSize(int sz); boolean isEmpty(); boolean contains(float n); int indexOf(float n); int lastIndexOf(float n); ArrayListOfFloats clone(); float get(int index); float set(int index, float element); ArrayListOfFloats add(float e); ArrayListOfFloats add(int index, float element); float remove(int index); void clear(); float[] getArray(); Iterator<Float> iterator(); String toString(int n); @Override String toString(); void sort(); ArrayListOfFloats intersection(ArrayListOfFloats other); ArrayListOfFloats merge(ArrayListOfFloats sortedLst); ArrayListOfFloats subList(int start, int end); void addUnique(int[] arr); void shiftLastNToTop(int n); @Override boolean equals(Object obj);  }### Answer:
@Test public void testArrayConstructor() { float[] arr = new float[] { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f }; assertEquals(5, arr.length); ArrayListOfFloats list = new ArrayListOfFloats(arr); list.remove(2); assertEquals(1.0f, arr[0], 10e-6); assertEquals(2.0f, arr[1], 10e-6); assertEquals(3.0f, arr[2], 10e-6); assertEquals(4.0f, arr[3], 10e-6); assertEquals(5.0f, arr[4], 10e-6); }
@Test public void testRemove() { ArrayListOfFloats list = new ArrayListOfFloats(); for (int i = 0; i < 10; i++) { list.add((float) i); } list.remove(list.indexOf(5.0f)); assertEquals(9, list.size()); assertEquals(0.0f, list.get(0), 10e-6); assertEquals(1.0f, list.get(1), 10e-6); assertEquals(2.0f, list.get(2), 10e-6); assertEquals(3.0f, list.get(3), 10e-6); assertEquals(4.0f, list.get(4), 10e-6); assertEquals(6.0f, list.get(5), 10e-6); assertEquals(7.0f, list.get(6), 10e-6); assertEquals(8.0f, list.get(7), 10e-6); assertEquals(9.0f, list.get(8), 10e-6); list.remove(list.indexOf((short) 9)); assertEquals(8, list.size); assertEquals(0.0f, list.get(0), 10e-6); assertEquals(1.0f, list.get(1), 10e-6); assertEquals(2.0f, list.get(2), 10e-6); assertEquals(3.0f, list.get(3), 10e-6); assertEquals(4.0f, list.get(4), 10e-6); assertEquals(6.0f, list.get(5), 10e-6); assertEquals(7.0f, list.get(6), 10e-6); assertEquals(8.0f, list.get(7), 10e-6); }