Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collections; public class Main { @SafeVarargs public static <D> ArrayList<D> createList(D... data) { ArrayList<D> dList = new ArrayList<>(); Collections.addAll(dList, data); return dList; } }