Here you can find the source of copyToList(T[] array)
public static <T> List<T> copyToList(T[] array)
//package com.java2s; // it under the terms of the GNU Lesser General Public License as published by import java.util.ArrayList; import java.util.List; public class Main { /**/*from ww w . j a va 2 s.c om*/ * Copy the given array to a dynamic {@link List}. */ public static <T> List<T> copyToList(T[] array) { List<T> list = new ArrayList<T>(array.length); for (T elem : array) { list.add(elem); } return list; } }