### Question:
ArrayListOfFloats implements RandomAccess, Cloneable, Iterable<Float> { public ArrayListOfFloats subList(int start, int end) { ArrayListOfFloats sublst = new ArrayListOfFloats(end - start + 1); for (int i = start; i <= end; i++) { sublst.add(get(i)); } return sublst; } 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 testSubList() { ArrayListOfFloats a = new ArrayListOfFloats(new float[] { 1, 2, 3, 4, 5, 6, 7 }); ArrayListOfFloats c = a.subList(1, 5); assertEquals(5, c.size()); assertTrue(Math.abs(2 - c.get(0)) < 0.0001); assertTrue(Math.abs(3 - c.get(1)) < 0.0001); assertTrue(Math.abs(4 - c.get(2)) < 0.0001); assertTrue(Math.abs(5 - c.get(3)) < 0.0001); assertTrue(Math.abs(6 - c.get(4)) < 0.0001); a.clear(); assertEquals(5, c.size()); assertTrue(Math.abs(2 - c.get(0)) < 0.0001); assertTrue(Math.abs(3 - c.get(1)) < 0.0001); assertTrue(Math.abs(4 - c.get(2)) < 0.0001); assertTrue(Math.abs(5 - c.get(3)) < 0.0001); assertTrue(Math.abs(6 - c.get(4)) < 0.0001); }