static void addOrRemoveComponent(bool add, Container a, Component b) { if (add) addAndValidate(a, b); else removeAndValidate(a, b); }