static Set setWithNotifyOnAdd(final VF1 onAdd) { ret setWithNotifyOnAdd(onAdd, new HashSet); } static Set setWithNotifyOnAdd(final VF1 onAdd, Set set) { ret new NotifyingSet(set) { void change() {} public bool add(A a) { if (!super.add(a)) false; ret true with callF(onAdd, a); } public bool addAll(Collection l) { bool change = false; for (A a : l) if (add(a)) change = true; ret change; } }; }