Here you can find the source of toArrayList(T[] vals)
public static <T> List<T> toArrayList(T[] vals)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> toArrayList(T[] vals) { List<T> list = new ArrayList<T>(); for (T val : vals) { list.add(val); }//from w w w . java 2 s.co m return list; } }