Here you can find the source of unionList( Collection extends T> col1, Collection extends T> col2)
public static <T> List<? extends T> unionList( Collection<? extends T> col1, Collection<? extends T> col2)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { public static <T> List<? extends T> unionList( Collection<? extends T> col1, Collection<? extends T> col2) { List<T> result = new ArrayList<>(col1.size() + col2.size()); result.addAll(col1);/*from w ww . j ava 2 s . c om*/ result.addAll(col2); return result; } }