Here you can find the source of addAll(Collection
public static <T> void addAll(Collection<T> target, Iterable<? extends T> source)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.util.Collection; public class Main { public static <T> void addAll(Collection<T> target, Iterable<? extends T> source) { for (T t : source) { target.add(t);//www. j av a 2 s. c o m } } }