Here you can find the source of listOf(T... args)
@SuppressWarnings("unchecked") public static <T> ArrayList<T> listOf(T... args)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { @SuppressWarnings("unchecked") public static <T> ArrayList<T> listOf(T... args) { ArrayList<T> result = new ArrayList<T>(); for (T t : args) result.add(t);// w ww. j a v a 2s .co m return result; } }