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.Arrays; import java.util.Collections; import java.util.List; public class Main { public static <T> List<T> toList(final T[] array) { if (array == null) { return Collections.emptyList(); } else {// ww w. ja va2 s .c o m return Collections.unmodifiableList(Arrays.asList(array)); } } }