add clear() method

This commit is contained in:
2017-12-03 09:19:13 +01:00
parent b7ef9d2e6f
commit ef5d7817b2
2 changed files with 22 additions and 1 deletions

View File

@@ -447,6 +447,16 @@ public class IntListTest {
Assert.assertEquals(0, list.getCapacity());
}
@Test
public void testClear() {
final IntList list = IntList.of(2, 0, 1); // unsorted list
list.clear();
Assert.assertEquals(0, list.size());
Assert.assertEquals(0, list.getCapacity());
Assert.assertTrue(list.isSorted());
}
@Test
public void testHashCodeEquals() {
final IntList a = new IntList();