Support more Collection (and Map) types for immutable collections #151
Labels
enhancement
New feature or request
good first issue
Good for newcomers
PR welcome
A PR submitted for this issue would be welcome
Namely,
SortedSet
andNavigableSet
andSortedMap
andNavigableMap
. All of those have an unmodifiable wrapper available inCollections
. While not ideal and slightly worse than the actually immutable copies available viaList.copyOf
and friends, it's way better to have an unmodifiable wrapper (and a collection initialized to empty when nothing is in) than having null.This was really surprising to consistently get empty collections everywhere and suddenly there was a null because we changed a
Set
toSortedSet
.In a perfect world, there would be support for even more types, like what Immutables do: Multisets and Multimaps from Guava, BiMap, all ImmutableCollections, EnumMaps. But let's not jump there yet :)
The text was updated successfully, but these errors were encountered: