Here you can find the source of newArrayList(T anObj)
public static <T> List<T> newArrayList(T anObj)
//package com.java2s; import java.util.*; public class Main { /**// w ww . ja v a 2s . c om * Creates a new array list with given object. */ public static <T> List<T> newArrayList(T anObj) { return newArrayList(10, anObj); } /** * Creates a new array list with given object and capacity. */ public static <T> List<T> newArrayList(int aCapacity, T anObj) { List list = new ArrayList(aCapacity); if (anObj != null) list.add(anObj); return list; } /** * Creates a new array list with given objects. */ public static <T> List<T> newArrayList(T... theObjects) { return newArrayList(theObjects.length, theObjects); } /** * Creates a new array list with given objects and capacity. */ public static <T> List<T> newArrayList(int aCapacity, T... theObjects) { List list = new ArrayList(Math.min(theObjects.length, aCapacity)); for (T item : theObjects) list.add(item); return list; } /** * Adds an object to the given list and returns list (creates list if missing). */ public static <T> List<T> add(List<T> aList, T anObj) { // If list is null, create list if (aList == null) aList = new Vector(); // Add object aList.add(anObj); // Return list return aList; } }