Here you can find the source of union(List
public static <T> List<T> union(List<T> set1, List<T> set2)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> union(List<T> set1, List<T> set2) { List<T> unionSet = new ArrayList<T>(set1); unionSet.addAll(set2);//from www .java 2 s . c o m return unionSet; } }