You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
From @jnehlmeier in #9860
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
norCollections.unmodifiableSet
, but other implementations rely on their correctness.The text was updated successfully, but these errors were encountered: