Here you can find the source of arrayToList(E[] array)
public static <E> List<E> arrayToList(E[] array)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static <E> List<E> arrayToList(E[] array) { List<E> list = new ArrayList<E>(array.length); for (int i = 0; i < array.length; i++) { list.add(array[i]);// w w w .j a va2 s . c o m } return list; } public static <E> List<E> arrayToList(E[] array, int size) { List<E> list = new ArrayList<E>(size); for (int i = 0; i < array.length; i++) { list.add(array[i]); } return list; } }