By looking at the code of Collections class, i got to know that when we are using the method unmodifiableList(List list)
or unmodifiableCollection(Coll
From documentation:
public static List unmodifiableList(List list)
Returns an unmodifiable view of the specified list. This method allows modules to provide users with "read-only" access to internal lists. Query operations on the returned list "read through" to the specified list, and attempts to modify the returned list, whether direct or via its iterator, result in an UnsupportedOperationException.