Here you can find the source of addAll(List
@SafeVarargs public static <T> List<T> addAll(List<T> src, T... args)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { @SafeVarargs public static <T> List<T> addAll(List<T> src, T... args) { if (src == null) { return null; }//from w ww. ja v a2s . co m for (T t : args) { src.add(t); } return src; } }