diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index dd2f0255a..22564c89a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -21,6 +21,9 @@
+
+ Fix flaky AbstractMultiValuedMapTest#testToString.
+
Fix flaky UnmodifiableMultiValuedMapTest.
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 0d845ec79..426327a7f 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
@@ -675,7 +675,10 @@ public abstract class AbstractMultiValuedMapTest extends AbstractObjectTes
map.put((K) "B", (V) "U");
map.put((K) "B", (V) "V");
map.put((K) "B", (V) "W");
- assertEquals("{A=[X, Y, Z], B=[U, V, W]}", map.toString());
+ assertTrue(
+ "{A=[X, Y, Z], B=[U, V, W]}".equals(map.toString()) ||
+ "{B=[U, V, W], A=[X, Y, Z]}".equals(map.toString())
+ );
try {
final MultiValuedMap originalNull = null;
@@ -684,7 +687,10 @@ public abstract class AbstractMultiValuedMapTest extends AbstractObjectTes
} catch (final NullPointerException npe) {
// expected
}
- assertEquals("{A=[X, Y, Z], B=[U, V, W]}", map.toString());
+ assertTrue(
+ "{A=[X, Y, Z], B=[U, V, W]}".equals(map.toString()) ||
+ "{B=[U, V, W], A=[X, Y, Z]}".equals(map.toString())
+ );
map.remove("A");
map.remove("B");