Returns an unmodifiable List containing the elements of the given Collection, in its iteration order. The given Collection must not be null, and it must not contain any null elements. If the given Collection is subsequently modified, the returned List will not reflect such modifications.
<E> | the List 's element type | |
coll | a Collection from which elements are drawn, must be non-null |
List
containing the elements of the given Collection
NullPointerException | if coll is null, or if it contains any nulls |
@implNote
If the given Collection is an unmodifiable List,
calling copyOf will generally not create a copy.
Diagram: Collection List