Here you can find the source of listOf(A[] objs)
public static <A> List<A> listOf(A[] objs)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static <A> List<A> listOf(A[] objs) { List<A> list = new ArrayList<A>(); for (A a : objs) list.add(a);//from w w w .ja va 2 s. c o m return list; } public static List<Integer> listOf(int[] objs) { List<Integer> list = new ArrayList<Integer>(); for (int a : objs) list.add(a); return list; } public static List<Character> listOf(char[] objs) { List<Character> list = new ArrayList<Character>(); for (char a : objs) list.add(a); return list; } }