Here you can find the source of addAll(Collection
public static <T> void addAll(Collection<T> left, Collection<T> right)
//package com.java2s; /*//from w ww . j a v a 2s . c om * Copyright Siemens AG, 2014-2016. * With modifications by Bosch Software Innovations GmbH, 2016 * Part of the SW360 Portal Project. * * SPDX-License-Identifier: EPL-1.0 * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ import java.util.*; public class Main { /** * Add all from right to left collection */ public static <T> void addAll(Collection<T> left, Collection<T> right) { if (left != null && right != null) { left.addAll(right); } } }