Here you can find the source of toList(T[] array)
public static <T> List<T> toList(T[] array)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { public static <T> List<T> toList(T[] array) { ArrayList<T> toRet = new ArrayList<T>(); Collections.addAll(toRet, array); return toRet; }/*from w ww . j av a2s. c o m*/ }