Skip to content

Conversation

@Partha-SUST16
Copy link
Contributor

@Partha-SUST16 Partha-SUST16 commented Jun 8, 2025

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:

  • add always returns true, even if an element is discarded.
  • isEmpty returns a boolean indicating whether the queue is empty.

For MultiKeyMap:

  • put throws a ClassCastException if the key is not a MultiKey.
  • multiKeyMap throws a NullPointerException when the provided map is null.
  • removeAll returns 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!

@Partha-SUST16 Partha-SUST16 changed the title Added missing functionality test for MultiKeyMap.put, MultiKeyMap.multiKeyMap, MultiKeyMap.removeAll, CircularFifoQueue.add, CircularFifoQueue.isEmpty Added missing functionality test for MultiKeyMap.put, multiKeyMap, removeAll, CircularFifoQueue.add, isEmpty Jun 10, 2025
@Partha-SUST16 Partha-SUST16 changed the title Added missing functionality test for MultiKeyMap.put, multiKeyMap, removeAll, CircularFifoQueue.add, isEmpty Added missing functionality unit test for MultiKeyMap.put, multiKeyMap, removeAll, CircularFifoQueue.add, isEmpty Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant