Here you can find the source of newArrayList(T... elements)
@SafeVarargs public static <T> List<T> newArrayList(T... elements)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /***//from ww w. j a v a 2 s .c o m * Avoid dependency on Guava types */ @SafeVarargs public static <T> List<T> newArrayList(T... elements) { List<T> list = new ArrayList<>(1); Collections.addAll(list, elements); return list; } public static <T> List<T> newArrayList(T element) { List<T> list = new ArrayList<>(1); list.add(element); return list; } }