@SuppressWarnings({"unchecked"})
public static <E> List<E> copyOf (Collection<? extends E> coll)

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.

Parameters:
<E>    the List's element type
coll    a Collection from which elements are drawn, must be non-null

Returns:  a List containing the elements of the given Collection

Exceptions:
NullPointerException    if coll is null, or if it contains any nulls

Since:  10

@implNote If the given Collection is an unmodifiable List, calling copyOf will generally not create a copy.