This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-collections.git
commit 13e7fe0bcf7110e72057fda29dd952b9190c2ebf Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Mar 31 09:43:47 2024 -0400 Rework test fixtures Next, grow the amount of data tested to find bugs in the tests with non-repeatable map ordering --- .../multimap/AbstractMultiValuedMapTest.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java index c9665c862..a1fa2bcdd 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java @@ -493,7 +493,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes } public MultiValuedMap<K, V> getConfirmed() { - return this.confirmed; + return confirmed; } /** @@ -509,7 +509,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes } public MultiValuedMap<K, V> getMap() { - return this.map; + return map; } public int getSampleCountPerKey() { @@ -756,9 +756,17 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes } resetFull(); final Map<K, Collection<V>> mapCol = getMap().asMap(); - mapCol.remove("k0"); + final int maxK = getSampleKeySize(); + int expectedSize = getMap().size(); + for (int k = 0; k < maxK; k++) { + final K key = makeKey(k); + mapCol.remove(key); + assertFalse(getMap().containsKey(key)); + expectedSize -= getSampleCountPerKey(); + assertEquals(expectedSize, getMap().size()); + } assertFalse(getMap().containsKey("k0")); - assertEquals(4, getMap().size()); + assertEquals(0, getMap().size()); } @Test