Here you can find the source of addAllIfNotNull(final Collection super E> collection, final Collection extends E> c)
public static <E> boolean addAllIfNotNull(final Collection<? super E> collection, final Collection<? extends E> c)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static <E> boolean addAllIfNotNull(final Collection<? super E> collection, final Collection<? extends E> c) { return (collection != null) && (c != null) && collection.addAll(c); }// w w w . ja va 2 s .c om }