diff --git a/src/test/java/speiger/src/collections/ints/base/BaseIntCollectionTest.java b/src/test/java/speiger/src/collections/ints/base/BaseIntCollectionTest.java index c9f0cc9..f670a2e 100644 --- a/src/test/java/speiger/src/collections/ints/base/BaseIntCollectionTest.java +++ b/src/test/java/speiger/src/collections/ints/base/BaseIntCollectionTest.java @@ -118,6 +118,14 @@ public abstract class BaseIntCollectionTest extends BaseIntIterableTest Assert.assertTrue(collection.removeAll(Arrays.asList(IntArrays.wrap(CONTAINS_ARRAY)))); } + @Test + public void testRemoveAllListener() { + if(!getValidCollectionTests().contains(CollectionTest.REMOVE_ALL_LISTENER)) return; + IntCollection collection = create(TEST_ARRAY); + Assert.assertTrue(collection.removeAll(create(CONTAINS_ARRAY), T -> {})); + Assert.assertFalse(collection.removeAll(create(CONTAINS_ARRAY), T -> Assert.assertTrue(false))); + } + @Test public void testRetainAll() { if(!getValidCollectionTests().contains(CollectionTest.RETAIN_ALL)) return; @@ -135,6 +143,23 @@ public abstract class BaseIntCollectionTest extends BaseIntIterableTest Assert.assertTrue(collection.isEmpty()); } + @Test + public void testRetainAllListener() { + if(!getValidCollectionTests().contains(CollectionTest.RETAIN_ALL_LISTENER)) return; + IntCollection collection = create(TEST_ARRAY); + IntCollection retained = create(CONTAINS_ARRAY); + Assert.assertTrue(collection.retainAll(retained, T -> {})); + Assert.assertFalse(collection.retainAll(retained, T -> Assert.assertTrue(false))); + Assert.assertEquals(CONTAINS_ARRAY.length, collection.size()); + int[] retainedArray = retained.toIntArray(); + int[] collectionArray = collection.toIntArray(); + IntArrays.stableSort(retainedArray); + IntArrays.stableSort(collectionArray); + Assert.assertArrayEquals(retainedArray, collectionArray); + collection.retainAll(IntCollections.EMPTY, T -> {}); + Assert.assertTrue(collection.isEmpty()); + } + @Test public void testToArray() { if(!getValidCollectionTests().contains(CollectionTest.TO_ARRAY)) return; diff --git a/src/test/java/speiger/src/collections/ints/base/BaseIntListTest.java b/src/test/java/speiger/src/collections/ints/base/BaseIntListTest.java index f903da8..702b861 100644 --- a/src/test/java/speiger/src/collections/ints/base/BaseIntListTest.java +++ b/src/test/java/speiger/src/collections/ints/base/BaseIntListTest.java @@ -64,6 +64,16 @@ public abstract class BaseIntListTest extends BaseIntCollectionTest for(int i = 0;i