commons-collections
commons-collections copied to clipboard
Added missing functionality unit test for MultiKeyMap.put, multiKeyMap, removeAll, CircularFifoQueue.add, isEmpty
Hi,
I’ve added unit tests for certain behaviors in the CircularFifoQueue and MultiKeyMap classes that are described in the Javadoc but were not explicitly tested before. These tests do not increase code coverage, as the relevant lines are already executed by other tests, but they help make the intended behavior more explicit and well-documented through testing.
For CircularFifoQueue:
addalways returns true, even if an element is discarded.isEmptyreturns a boolean indicating whether the queue is empty.
For MultiKeyMap:
putthrows aClassCastExceptionif the key is not a MultiKey.multiKeyMapthrows aNullPointerExceptionwhen the provided map is null.removeAllreturns a boolean to indicate if any entries were removed.
I added separate test methods for each of these behaviors in their respective test classes. Even though they don’t increase coverage metrics, I believe these tests are useful for improving clarity, helping future maintainers understand the method contracts better, and guarding against subtle regressions.
Thanks!