@Override
    public AnAction @NotNull [] getChildren(@Nullable AnActionEvent e) {
      AnAction[] children = delegate.getChildren(e);
      Condition<AnAction> popupCondition = o ->
        o instanceof PopupInMainMenuActionGroup ||
        o instanceof ActionGroup && ((ActionGroup)o).isPopup();
      if (ContainerUtil.find(children, popupCondition) == null) {
        return children;
      }
      ArrayList<AnAction> actions = new ArrayList<>(2 * children.length);
      for (AnAction child : children) {
        if (!popupCondition.value(child)) {
          actions.add(child);
          continue;
        }
        AtomicReference<String> separatorText = new AtomicReference<>(child.getTemplateText());
        actions.add(new Separator(separatorText::get));
        actions.add(new MyGroup((ActionGroup)child, actionManager) {
          @Override
          public void update(@NotNull AnActionEvent e) {
            delegate.update(e);
            separatorText.set(e.getPresentation().getText());
          }
        });
        actions.add(Separator.getInstance());
      }
      return actions.toArray(EMPTY_ARRAY);
    }
@Override
    public AnAction @NotNull [] getChildren(@Nullable AnActionEvent e)