Java tutorial
//package com.java2s; import java.util.Collection; public class Main { /** * <p>Contact Collection A to Collection B</p> * @param <E> * @param c1 * @param c2 * @return */ public static <E extends Object> Collection<E> contact(Collection<E> c1, Collection<E> c2) { if (c1 == null) { return c2; } else if (c2 == null) { return c1; } c1.addAll(c2); return c1; } }