Here you can find the source of asList(T... array)
@SafeVarargs
static <T> List<T> asList(T... array)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; import java.util.Iterator; public class Main { @SafeVarargs static <T> List<T> asList(T... array) { List<T> l = new ArrayList<T>(); for (T t : array) l.add(t);// w ww . j a v a 2s. co m return l; } static <T> List<T> asList(Iterator<T> iter) { List<T> l = new ArrayList<T>(); while (iter.hasNext()) l.add(iter.next()); return l; } }