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

commit 456be0917f59893bdd60e28fea94c93d07bd22c9
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Mon Jun 16 08:02:21 2025 -0400

    Add missing test coverage for
    org.apache.commons.lang3.reflect.TypeUtils.equals(Type, Type)
---
 .../org/apache/commons/lang3/reflect/TypeUtilsTest.java     | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java 
b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java
index 1d11698cf..558bde591 100644
--- a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java
@@ -440,6 +440,19 @@ void testDetermineTypeArguments() throws 
NoSuchFieldException {
         assertThrows(NullPointerException.class, () -> 
TypeUtils.determineTypeArguments(null, iterableType));
     }
 
+    @Test
+    void testEquals() throws NoSuchFieldException {
+        final Type expected = 
getClass().getField("intWildcardComparable").getGenericType();
+        final GenericArrayType gat1 = TypeUtils
+                .genericArrayType(TypeUtils.parameterize(Comparable.class, 
TypeUtils.wildcardType().withUpperBounds(Integer.class).build()));
+        final GenericArrayType gat2 = TypeUtils
+                .genericArrayType(TypeUtils.parameterize(Comparable.class, 
TypeUtils.wildcardType().withUpperBounds(Integer.class).build()));
+        assertTrue(TypeUtils.equals(gat1, gat1));
+        assertTrue(TypeUtils.equals(gat1, gat2));
+        assertFalse(TypeUtils.equals(gat1, null));
+        assertFalse(TypeUtils.equals(null, gat1));
+    }
+
     @SuppressWarnings("unlikely-arg-type")
     @Test
     void testGenericArrayType() throws NoSuchFieldException {

Reply via email to