Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static <T> List<T> concat(Collection<? extends T> xs, Collection<? extends T> ys) { ArrayList<T> result = new ArrayList<>(xs.size() + ys.size()); result.addAll(xs); result.addAll(ys); return result; } }