Add junit for GrowthListTest(int initialCapacity) (#92)

This commit is contained in:
dota17 2019-10-25 07:11:40 +08:00 committed by Gary Gregory
parent 6e1443e3b1
commit 3bb76c2da1

View File

@ -44,6 +44,21 @@ public class GrowthListTest<E> extends AbstractListTest<E> {
return GrowthList.growthList(list);
}
//-----------------------------------------------------------------------
public void testGrowthList() {
final Integer zero = Integer.valueOf(0);
final Integer one = Integer.valueOf(1);
final Integer two = Integer.valueOf(2);
final GrowthList<Integer> grower = new GrowthList(1);
assertEquals(0, grower.size());
grower.add(0, zero);
assertEquals(1, grower.size());
grower.add(1, one);
assertEquals(2, grower.size());
grower.add(2, two);
assertEquals(3, grower.size());
}
//-----------------------------------------------------------------------
public void testGrowthAdd() {
final Integer one = Integer.valueOf(1);