Here you can find the source of concat(List
public static <T> List<T> concat(List<T> collection1, List<T> collection2)
//package com.java2s; import java.util.Collection; import java.util.List; import java.util.Map; public class Main { public static <T> List<T> concat(List<T> collection1, List<T> collection2) { if (isEmpty(collection1)) { return collection2; }/*ww w. ja v a 2 s . co m*/ if (isEmpty(collection2)) { return collection1; } collection1.addAll(collection2); return collection1; } public static boolean isEmpty(Map<?, ?> map) { return (map == null) || (map.size() == 0); } public static boolean isEmpty(Collection<?> collection) { return (collection == null) || (collection.size() == 0); } }