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