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