static void addOrRemove(Collection c, A a, bool add) { if (add) c.add(a); else c.remove(a); }