Fixed AVLTrees pollFirst/pollLast

This commit is contained in:
2021-07-23 22:04:59 +02:00
parent 4a3cc66401
commit 73916f4fd9
4 changed files with 14 additions and 16 deletions
@@ -49,8 +49,15 @@ public abstract class BaseIntSortedSetTest extends BaseIntCollectionTest
public void pollTest() {
if(getValidSortedSetTests().contains(SortedSetTest.POLL)) {
IntSortedSet set = create(TEST_ARRAY);
Assert.assertEquals(set.pollFirstInt(), 0);
Assert.assertEquals(set.pollLastInt(), 99);
for(int i = 0;i<100;i++)
{
Assert.assertEquals(i, set.pollFirstInt());
}
set = create(TEST_ARRAY);
for(int i = 99;i>=0;i--)
{
Assert.assertEquals(i, set.pollLastInt());
}
}
}