Here you can find the source of combine(Collection extends T> first, Collection extends T> second)
public static <T> List<T> combine(Collection<? extends T> first, Collection<? extends T> second)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010-2011 Sonatype, Inc. * 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.ArrayList; import java.util.Collection; import java.util.List; public class Main { public static <T> List<T> combine(Collection<? extends T> first, Collection<? extends T> second) { List<T> result = new ArrayList<T>(first.size() + second.size()); result.addAll(first);//w ww .ja v a 2 s.c om result.addAll(second); return result; } }