boolean (ActionGroup group) { if (group instanceof WeighingNewActionGroup) { return true; } if (group instanceof ActionGroupWrapper actionGroupWrapper) { return isNewElementGroup(actionGroupWrapper.getDelegate()); } return false; }