Use following methods:
1 Collections.unmodifiableList(list);
2 Collections.unmodifiableSet(set);
3 Collections.unmodifiableMap(map);
These methods takes collection parameter and return a new read-only collection
with same elements as in original collection.
Read More →