Here you can find the source of add(List
public static <T> List<T> add(List<T> aList, T anObj)
//package com.java2s; import java.util.*; public class Main { /**/*from ww w .ja va2s .co m*/ * 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; } }