@Test void clearTest() { final HopscotchCollection<Integer> hopscotchCollection = new HopscotchCollection<>(testVals); hopscotchCollection.clear(); Assert.assertEquals(hopscotchCollection.size(), 0); Assert.assertEquals(SVUtils.iteratorSize(hopscotchCollection.iterator()), 0); }
@Test void sizeTest() { final HopscotchCollection<Integer> hopscotchCollection = new HopscotchCollection<>(); Assert.assertEquals(hopscotchCollection.size(), 0); hopscotchCollection.addAll(testVals); Assert.assertEquals(hopscotchCollection.size(), testVals.size()); hopscotchCollection.add(notInTestVals); Assert.assertEquals(hopscotchCollection.size(), testVals.size() + 1); hopscotchCollection.removeEach(notInTestVals); Assert.assertEquals(hopscotchCollection.size(), testVals.size()); hopscotchCollection.clear(); Assert.assertEquals(hopscotchCollection.size(), 0); }