public void testClear() { IntList i = new IntList(); int n = 5; for (int v = 0; v < n; v++) i.add(10 + v); Assert.AreEqual(n, i.size()); i.clear(); Assert.AreEqual(0, i.size()); try { i.get(0); Assert.Fail("Accepted 0 index on empty list"); } catch (IndexOutOfRangeException) { Assert.IsTrue(true); } }