并集到哈希集
import java.util.*; /* *来 自 N o w J a v a . c o m */ public class Main{ public static void main(String[] argv){ Collection collections = java.util.Arrays.asList("asdf","nowjava.com"); System.out.println(unionToHashSet(collections)); } public static <T> HashSet<T> unionToHashSet( final Collection<T>... collections) { final HashSet<T> res = new HashSet<T>(); for (final Collection<T> set : collections) { res.addAll(set); } return res; } public static <T> HashSet<T> unionToHashSet( final Collection<T> collection, final T... items) { final HashSet<T> result =