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