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);
}