Here you can find the source of arrayToList(T array[])
public static <T> ArrayList<T> arrayToList(T array[])
//package com.java2s; import java.util.ArrayList; import java.util.Arrays; public class Main { public static <T> ArrayList<T> arrayToList(T array[]) { if (null == array) { return null; }//from ww w . j a va 2 s . c om return new ArrayList<T>(Arrays.asList(array)); } }