放码过来
package com.lun.util;
import java.util.HashSet;
import java.util.Set;
public class SetUtils {
public static <T> Set<T> union(Set<T> setA, Set<T> setB) {
Set<T> tmp = new HashSet<T>(setA);
tmp.addAll(setB);
return tmp;
}
public static <T> Set<T> intersection(Set<T> setA, Set<T> setB) {
Set<T> tmp = new HashSet<T>();
for (T x : setA)
if (setB.contains(x)