You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/12/05 15:17:41 UTC

[commons-collections] branch master updated: Fix flaky CollectionUtilsTest.getFromMap() (#200)

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


The following commit(s) were added to refs/heads/master by this push:
     new 2f18447  Fix flaky CollectionUtilsTest.getFromMap() (#200)
2f18447 is described below

commit 2f18447ed598383bac5475ec3936c33ea36a3abb
Author: Xin Tong <xi...@illinois.edu>
AuthorDate: Sat Dec 5 09:17:05 2020 -0600

    Fix flaky CollectionUtilsTest.getFromMap() (#200)
---
 .../java/org/apache/commons/collections4/CollectionUtilsTest.java   | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
index 4cb5590..1afdb78 100644
--- a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
@@ -988,12 +988,10 @@ public class CollectionUtilsTest extends MockTestCase {
         expected.put("zeroKey", "zero");
         expected.put("oneKey", "one");
 
-        final Map<String, String> found = new HashMap<>();
         Map.Entry<String, String> entry = CollectionUtils.get(expected, 0);
-        found.put(entry.getKey(), entry.getValue());
+        assertTrue(entry.toString().equals("zeroKey=zero") || entry.toString().equals("oneKey=one"));
         entry = CollectionUtils.get(expected, 1);
-        found.put(entry.getKey(), entry.getValue());
-        assertEquals(expected, found);
+        assertTrue(entry.toString().equals("zeroKey=zero") || entry.toString().equals("oneKey=one"));
 
         // Map index out of range
         try {