Here you can find the source of newArrayList()
public static <T> ArrayList<T> newArrayList()
//package com.java2s; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { public static <T> ArrayList<T> newArrayList() { return new ArrayList<>(); }//from www. j a v a 2 s . c om @SuppressWarnings("unchecked") public static <T> ArrayList<T> newArrayList(T... elements) { ArrayList<T> list = newArrayList(); addElements(list, elements); return list; } public static <T> ArrayList<T> newArrayList(int capacity) { return new ArrayList<>(capacity); } public static <T> ArrayList<T> newArrayList(Collection<? extends T> c) { return new ArrayList<>(c); } public static <T> boolean addElements(List<T> list, T[] array) { boolean good = true; for (T obj : array) { good &= list.add(obj); } return good; } }