Tag Archives: SortedMap

Special collection implementations

Read-only collections After you’ve added all the necessary elements to a collection, it may be convenient to treat that collection as read-only, to prevent the accidental modification of the collection. To provide this capability, the Collections class provides six factory methods, one for each of Collection, List, Map, Set, SortedMap, and SortedSet. Collection unmodifiableCollection(Collection collection) […]