Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { @SafeVarargs public static <A> List<A> listCat(List<A>... lists) { if (lists.length == 0) return Collections.<A>emptyList(); else if (lists.length == 1) return lists[0]; else { List<A> full = new ArrayList<A>(); for (List<A> xs : lists) full.addAll(xs); return full; } } }