Here you can find the source of add(List valList, Object src)
public static List add(List valList, Object src)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static List add(List valList, Object src) { if (src == null) { return valList; }// ww w. ja va 2s .c o m if (src instanceof List) { valList.addAll((List) src); } else { valList.add(src); } return valList; } }