Java tutorial
//package com.java2s; import java.util.*; public class Main { public static <T> Collection<T> union(Collection<T> col1, Collection<T> col2) { Set<T> set = new HashSet<T>(clone(col1)); set.addAll(col2); return set; } public static <T> List<T> clone(Collection<T> col) { List<T> destCol = new ArrayList<T>(); for (T o : col) { destCol.add(o); } return destCol; } }