Here you can find the source of copy(List
public static <T> List<T> copy(List<T> toCopy)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static <T> List<T> copy(List<T> toCopy) { List<T> res = new ArrayList<>(toCopy.size()); res.addAll(toCopy);/* w ww.j a v a 2 s . co m*/ return res; } }