public static < T > List < T > copyOf ( T [ ] elements ) { Preconditions . checkNotNull ( elements ) ; return ofInternal ( elements . clone ( ) ) ; }
Creates an immutable list that consists of the elements in the given array . A copy of the given array is used which means that any modifications to the given array will not affect the immutable list .