Here you can find the source of arrayToList(T[] array)
public static <T> List<T> arrayToList(T[] array)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static <T> List<T> arrayToList(T[] array) { return isArrayEmpty(array) ? new ArrayList<T>(1) : Arrays.asList(array); }/*from w ww .j ava2 s.c o m*/ public static <T> boolean isArrayEmpty(T[] array) { if (null == array || array.length <= 0) { return true; } else { return false; } } }