Here you can find the source of listOf(T value, int size)
public static <T> List<T> listOf(T value, int size)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> listOf(T value, int size) { List<T> list = new ArrayList<T>(size); list.add(value);// w ww .ja v a 2 s . co m return list; } public static <T> List<T> listOf(T value) { List<T> list = new ArrayList<T>(); list.add(value); return list; } public static <T> List<T> listOf(T value1, T value2) { List<T> list = new ArrayList<T>(); list.add(value1); list.add(value2); return list; } public static <T> List<T> listOf(T value1, T value2, T value3) { List<T> list = new ArrayList<T>(); list.add(value1); list.add(value2); list.add(value3); return list; } }