Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify tests for unmodifiable emulation #9882

Open
niloc132 opened this issue Dec 23, 2023 · 0 comments
Open

Unify tests for unmodifiable emulation #9882

niloc132 opened this issue Dec 23, 2023 · 0 comments

Comments

@niloc132
Copy link
Contributor

From @jnehlmeier in #9860

Maybe we should refactor a bit in a follow up commit that introduces a helper class to check immutability of collections/sets, lists, maps. We now have many tests that need it: CollectionsTest, ListTest, SetTest, MapTest, CollectorsTest. Each doing it a bit differently and not covering everything.

The CollectionsTest.doTestModificationsToList method could be made public and static and reused for other List cases, and easily generalized for Collection/Set - adding another validator for Map should be easy as well.

Note that there are no direct tests at this time for Collections.unmodifiableMap nor Collections.unmodifiableSet, but other implementations rely on their correctness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant