blob: 6daeaadb4aa7e79c8e3381c5801d9e01a8b8853b [file] [log] [blame]
package aQute.lib.collections;
import java.util.*;
public class Logic {
public static <T> Collection<T> retain(Collection<T> first, Collection<T>... sets) {
Set<T> result = new HashSet<T>(first);
for (Collection<T> set : sets) {
result.retainAll(set);
}
return result;
}
public static <T> Collection<T> remove(Collection<T> first, Collection<T>... sets) {
Set<T> result = new HashSet<T>(first);
for (Collection<T> set : sets) {
result.removeAll(set);
}
return result;
}
}