Here you can find the source of concat(Collection
public static <T> Collection<T> concat(Collection<T> a, Collection<T> b)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static <T> Collection<T> concat(Collection<T> a, Collection<T> b) { Collection<T> result = new ArrayList<>(a.size() + b.size()); result.addAll(a);// w ww . j av a2 s . c o m result.addAll(b); return Collections.unmodifiableCollection(result); } }