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-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new 73026e23d Add testPairOfAbstractMapSimpleEntry()
73026e23d is described below

commit 73026e23dce21da8c5c1aa015fe5b63828eb68ad
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Thu Sep 26 09:09:28 2024 -0400

    Add testPairOfAbstractMapSimpleEntry()
---
 src/test/java/org/apache/commons/lang3/tuple/PairTest.java | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/test/java/org/apache/commons/lang3/tuple/PairTest.java 
b/src/test/java/org/apache/commons/lang3/tuple/PairTest.java
index 229c8b4f6..0afd34291 100644
--- a/src/test/java/org/apache/commons/lang3/tuple/PairTest.java
+++ b/src/test/java/org/apache/commons/lang3/tuple/PairTest.java
@@ -23,6 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
+import java.util.AbstractMap;
 import java.util.Calendar;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -260,6 +261,16 @@ public class PairTest extends AbstractLangTest {
         assertEquals("y", pair.getRight());
     }
 
+    @Test
+    public void testPairOfAbstractMapSimpleEntry() {
+        final Entry<Integer, String> entry = new AbstractMap.SimpleEntry<>(0, 
"foo");
+        final Pair<Integer, String> pair = Pair.of(entry);
+        assertEquals(entry.getKey(), pair.getLeft());
+        assertEquals(entry.getValue(), pair.getRight());
+        assertEquals(entry, pair);
+        assertEquals(pair, entry);
+    }
+
     @Test
     public void testPairOfMapEntry() {
         final HashMap<Integer, String> map = new HashMap<>();

Reply via email to