public class Util {
public static <T> MySet<T> setSubtract(Set <T> orig, Set<T> sub) {
MySet<T> newset=new MySet<T>();
- for(T e: orig) {
+ for(T e : orig) {
if (!sub.contains(e))
newset.add(e);
}
map.get(key).removeAll(toremove);
map.get(key).addAll(toadd);
} else {
- map.put(key, (MySet<V>) toadd.clone());
+ if (toadd!=null)
+ map.put(key, (MySet<V>)toadd.clone());
}
}