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.*; public class Main { public static <T> List<T> toList(T[] array) { List<T> result = new ArrayList<>(array.length); for (T o : array) { result.add(o);//from w w w .ja v a 2s.c o m } return result; } }