Here you can find the source of copyList(List
private static <T> List<T> copyList(List<T> original)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { private static <T> List<T> copyList(List<T> original) { List<T> copy = null; if (original != null) { copy = new ArrayList<T>(); if (!original.isEmpty()) { copy.addAll(original);/*from ww w. ja va 2 s .c o m*/ } } return copy; } }