Here you can find the source of toList(final T[] array)
public static <T> List<T> toList(final T[] array)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static <T> List<T> toList(final T[] array) { List<T> l = list(array.length); l.addAll(Arrays.asList(array)); return l; }/*from w ww . ja v a 2 s .co m*/ public static <T> List<T> list(final int initialCapacity) { return new ArrayList<T>(initialCapacity); } public static <T> List<T> list() { return new ArrayList<T>(); } @SafeVarargs public static <T> List<T> list(final T... objects) { List<T> l = list(); l.addAll(toList(objects)); return l; } }