Java tutorial
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { /** * Creates a list of values * * @param items Items to store in the list * @param <T> Type of value stored in the list * @return A list of values */ @SafeVarargs public static <T> List<T> listOf(T... items) { List<T> results = new ArrayList<>(items.length); Collections.addAll(results, items); return results; } }