This is an automated email from the ASF dual-hosted git repository.

garydgregory 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 ec02b85f0 Reduce copy-pasta in tests.
ec02b85f0 is described below

commit ec02b85f040b894cf5365cd9ce34264ad4c59d88
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Jun 27 13:49:39 2026 +0000

    Reduce copy-pasta in tests.
---
 .../commons/collections4/bidimap/DualTreeBidiMap2Test.java | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java
 
b/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java
index f8b030530..6b630da65 100644
--- 
a/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java
+++ 
b/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java
@@ -20,10 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.util.Collections;
 import java.util.Comparator;
@@ -107,15 +103,7 @@ public class DualTreeBidiMap2Test<K extends Comparable<K>, 
V extends Comparable<
     void testSerializeDeserializeCheckComparator() throws Exception {
         final SortedBidiMap<?, ?> obj = makeObject();
         if (obj instanceof Serializable && isTestSerialization()) {
-            final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-            final ObjectOutputStream out = new ObjectOutputStream(buffer);
-            out.writeObject(obj);
-            out.close();
-
-            final ObjectInputStream in = new ObjectInputStream(new 
ByteArrayInputStream(buffer.toByteArray()));
-            final Object dest = in.readObject();
-            in.close();
-
+            final Object dest = serializeDeserialize(obj);
             final SortedBidiMap<?, ?> bidi = (SortedBidiMap<?, ?>) dest;
             assertNotNull(obj.comparator());
             assertNotNull(bidi.comparator());

Reply via email to