Java tutorial
//package com.java2s; import java.util.Collection; import java.util.HashSet; public class Main { @SuppressWarnings("unchecked") public static Collection<? extends Object> getUnion(Collection<? extends Object> list1, Collection<? extends Object> list2) { @SuppressWarnings("rawtypes") Collection union = new HashSet(list1); union.addAll(list2); return union; } }