Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Collections; public class Main { public static <T> ArrayList<T> newList(T... elements) { ArrayList<T> list = new ArrayList<>(elements.length); Collections.addAll(list, elements); return list; } }