Added missing functionality unit test for MultiKeyMap.put, multiKeyMap, removeAll, CircularFifoQueue.add, isEmpty #620
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I’ve added unit tests for certain behaviors in the
CircularFifoQueueandMultiKeyMapclasses 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!