Here you can find the source of toList(V... elements)
@SafeVarargs public static <V> List<V> toList(V... elements)
//package com.java2s; // The MIT License (MIT) import java.util.ArrayList; import java.util.List; public class Main { @SafeVarargs public static <V> List<V> toList(V... elements) { return toList(new ArrayList<V>(), elements); }//from ww w. j a va 2s. co m @SafeVarargs public static <V> List<V> toList(List<V> l, V... elements) { for (V v : elements) { l.add(v); } return l; } }