Here you can find the source of addAll(C collection, T... elements)
public static <T, C extends Collection<T>> C addAll(C collection, T... elements)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; import java.util.Collection; import java.util.List; public class Main { public static <T, C extends Collection<T>> C addAll(C collection, T... elements) { collection.addAll(Arrays.asList(elements)); return collection; }//from w w w . j a v a 2 s . c o m public static <T> List<T> asList(T... elements) { return Arrays.asList(elements); } }