Here you can find the source of toList(T[] arr)
public static <T> java.util.List<T> toList(T[] arr)
//package com.java2s; public class Main { public static <T> java.util.List<T> toList(T[] arr) { java.util.List<T> rel = null; if (arr != null && arr.length > 0) { rel = new java.util.ArrayList<T>(); for (T item : arr) { rel.add(item);/*from w w w . j a v a 2 s. c o m*/ } } return rel; } }