Here you can find the source of asList(T[] a)
public static <T> List<T> asList(T[] a)
//package com.java2s; // are made available under the terms of the Eclipse Public License v1.0 import java.util.Arrays; import java.util.Collections; import java.util.List; public class Main { /** Array to List.// w ww . j a v a 2 s . c om * <p> * Works like {@link Arrays#asList(Object...)}, but handles null arrays. * @return a list backed by the array. */ public static <T> List<T> asList(T[] a) { if (a == null) return Collections.emptyList(); return Arrays.asList(a); } }