Java tutorial
//package com.java2s; import java.util.*; public class Main { public static <T> List<T> concatenate(Collection<? extends T> a, Collection<? extends T> b) { List<T> list = new ArrayList<T>(); list.addAll(a); list.addAll(b); return list; } public static <T> List<T> concatenate(Collection<? extends Collection<T>> lists) { List<T> list = new ArrayList<T>(); for (Collection<T> c : lists) { list.addAll(c); } return list; } }