assertEquals(5, arr[4]);
}
@Test
public void testRemove() {
ArrayListOfShorts list = new ArrayListOfShorts();
for ( int i=0; i<10; i++) {
list.add((short) i);
}
list.remove(list.indexOf((short) 5));
assertEquals(9, list.size());
assertEquals(0, list.get(0));
assertEquals(1, list.get(1));
assertEquals(2, list.get(2));
assertEquals(3, list.get(3));
assertEquals(4, list.get(4));
assertEquals(6, list.get(5));
assertEquals(7, list.get(6));
assertEquals(8, list.get(7));
assertEquals(9, list.get(8));
list.remove(list.indexOf((short) 9));
assertEquals(8, list.size);
assertEquals(0, list.get(0));
assertEquals(1, list.get(1));
assertEquals(2, list.get(2));
assertEquals(3, list.get(3));
assertEquals(4, list.get(4));
assertEquals(6, list.get(5));
assertEquals(7, list.get(6));
assertEquals(8, list.get(7));
}