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

commit bb83189e19c88b3ae2a418fcaa075fdd1fef87dc
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Aug 12 11:09:54 2026 -0400

    Sort members.
---
 .../collection/IndexedCollectionTest.java          | 40 +++++++++++-----------
 .../collections4/map/FixedSizeSortedMapTest.java   | 34 +++++++++---------
 2 files changed, 37 insertions(+), 37 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/collections4/collection/IndexedCollectionTest.java
 
b/src/test/java/org/apache/commons/collections4/collection/IndexedCollectionTest.java
index 94f3b703c..06467f8e0 100644
--- 
a/src/test/java/org/apache/commons/collections4/collection/IndexedCollectionTest.java
+++ 
b/src/test/java/org/apache/commons/collections4/collection/IndexedCollectionTest.java
@@ -148,26 +148,6 @@ class IndexedCollectionTest extends 
AbstractCollectionTest<String> {
         assertEquals("01", indexed.get(1));
     }
 
-    @Test
-    void testReindexUpdatesIndexWhenDecoratedCollectionIsModifiedSeparately() 
throws Exception {
-        final Collection<String> original = new ArrayList<>();
-        final IndexedCollection<Integer, String> indexed = 
decorateUniqueCollection(original);
-
-        original.add("1");
-        original.add("2");
-        original.add("3");
-
-        assertNull(indexed.get(1));
-        assertNull(indexed.get(2));
-        assertNull(indexed.get(3));
-
-        indexed.reindex();
-
-        assertEquals("1", indexed.get(1));
-        assertEquals("2", indexed.get(2));
-        assertEquals("3", indexed.get(3));
-    }
-
     @Test
     void testIteratorRemoveUpdatesIndex() {
         final IndexedCollection<Integer, String> indexed = 
decorateUniqueCollection(new ArrayList<>());
@@ -189,6 +169,26 @@ class IndexedCollectionTest extends 
AbstractCollectionTest<String> {
         assertEquals("1", indexed.get(1));
     }
 
+    @Test
+    void testReindexUpdatesIndexWhenDecoratedCollectionIsModifiedSeparately() 
throws Exception {
+        final Collection<String> original = new ArrayList<>();
+        final IndexedCollection<Integer, String> indexed = 
decorateUniqueCollection(original);
+
+        original.add("1");
+        original.add("2");
+        original.add("3");
+
+        assertNull(indexed.get(1));
+        assertNull(indexed.get(2));
+        assertNull(indexed.get(3));
+
+        indexed.reindex();
+
+        assertEquals("1", indexed.get(1));
+        assertEquals("2", indexed.get(2));
+        assertEquals("3", indexed.get(3));
+    }
+
     @Test
     void testRemovePreservesRemainingValuesWithSameTransformedKey() {
         @SuppressWarnings("unchecked")
diff --git 
a/src/test/java/org/apache/commons/collections4/map/FixedSizeSortedMapTest.java 
b/src/test/java/org/apache/commons/collections4/map/FixedSizeSortedMapTest.java
index 4d82c6616..d6231339f 100644
--- 
a/src/test/java/org/apache/commons/collections4/map/FixedSizeSortedMapTest.java
+++ 
b/src/test/java/org/apache/commons/collections4/map/FixedSizeSortedMapTest.java
@@ -40,23 +40,6 @@ public class FixedSizeSortedMapTest<K, V> extends 
AbstractSortedMapTest<K, V> {
         return "4";
     }
 
-    @Test
-    void testPutAllAllowsUpdatesRejectsNewKeys() {
-        final SortedMap<String, String> base = new TreeMap<>();
-        base.put("a", "1");
-        final SortedMap<String, String> fixed = 
FixedSizeSortedMap.fixedSizeSortedMap(base);
-        // updating the value of an existing key is allowed
-        fixed.putAll(Collections.singletonMap("a", "2"));
-        assertEquals("2", fixed.get("a"));
-        // an empty map is a no-op, not a rejection
-        fixed.putAll(Collections.emptyMap());
-        assertEquals(1, fixed.size());
-        // a new key must be rejected and must not grow the map
-        assertThrows(IllegalArgumentException.class, () -> 
fixed.putAll(Collections.singletonMap("b", "9")));
-        assertEquals(1, fixed.size());
-        assertFalse(fixed.containsKey("b"));
-    }
-
     @Override
     public boolean isPutAddSupported() {
         return false;
@@ -85,6 +68,23 @@ public class FixedSizeSortedMapTest<K, V> extends 
AbstractSortedMapTest<K, V> {
         return FixedSizeSortedMap.fixedSizeSortedMap(new TreeMap<>());
     }
 
+    @Test
+    void testPutAllAllowsUpdatesRejectsNewKeys() {
+        final SortedMap<String, String> base = new TreeMap<>();
+        base.put("a", "1");
+        final SortedMap<String, String> fixed = 
FixedSizeSortedMap.fixedSizeSortedMap(base);
+        // updating the value of an existing key is allowed
+        fixed.putAll(Collections.singletonMap("a", "2"));
+        assertEquals("2", fixed.get("a"));
+        // an empty map is a no-op, not a rejection
+        fixed.putAll(Collections.emptyMap());
+        assertEquals(1, fixed.size());
+        // a new key must be rejected and must not grow the map
+        assertThrows(IllegalArgumentException.class, () -> 
fixed.putAll(Collections.singletonMap("b", "9")));
+        assertEquals(1, fixed.size());
+        assertFalse(fixed.containsKey("b"));
+    }
+
 //    void testCreate() throws Exception {
 //        resetEmpty();
 //        writeExternalFormToDisk(

Reply via email to