@Override
  public void update(@NotNull AnActionEvent e) {
    int size = ActionGroupUtil.getVisibleActions(this, e).take(getChildrenCountThreshold() + 1).size();
    e.getPresentation().setEnabledAndVisible(size > 0);
    e.getPresentation().setPopupGroup(size > getChildrenCountThreshold());
    e.getPresentation().setDisableGroupIfEmpty(false);
  }
@Override
  public void update(@NotNull AnActionEvent e)