Here you can find the source of arrayToList(T[] array)
public static <T> List<T> arrayToList(T[] array)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> arrayToList(T[] array) { List<T> list = new ArrayList<T>(); if (array == null || array.length == 0) { return list; }/*from w w w . j a v a 2 s.c o m*/ for (T t : array) { list.add(t); } return list; } }