rootvector2 commented on code in PR #718:
URL: 
https://github.com/apache/commons-collections/pull/718#discussion_r3673500444


##########
src/test/java/org/apache/commons/collections4/SplitMapUtilsTest.java:
##########
@@ -116,12 +116,14 @@ void testReadableMap() {
         assertEquals(other, map);
         assertEquals(other.hashCode(), map.hashCode());
 
-        // remove
-        for (int i = 0; i < 10; i++) {
-            assertEquals(i, map.remove(String.valueOf(i)).intValue());
-            assertEquals(--sz, map.size());
-        }
-        assertTrue(map.isEmpty());
+        // remove, and the Map default methods that route through it
+        attemptPutOperation(() -> map.remove("0"));
+        attemptPutOperation(() -> map.remove("1", 1));
+        attemptPutOperation(() -> map.computeIfPresent("2", (k, v) -> null));
+        attemptPutOperation(() -> map.merge("3", 3, (a, b) -> null));
+
+        assertEquals(sz, map.size());
+        assertEquals(sz, backingMap.size());

Review Comment:
   added a `compute` case on an existing key next to `computeIfPresent` and 
`merge`; it throws and both the view and backing map sizes stay unchanged.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to