private @NotNull List<ActionGroup> collectActionGroups() {
      ContentManager contentManager = myToolWindow.getContentManagerIfCreated();
      Content selectedContent = contentManager == null ? null : contentManager.getSelectedContent();
      JComponent contentComponent = selectedContent == null ? null : selectedContent.getComponent();
      if (contentComponent == null) return Collections.emptyList();
      return JBIterable.from(iterateToolbars(Collections.singletonList(contentComponent)))
        .filterMap(toolbar -> {
          JComponent c = toolbar.getComponent();
          if (c.isVisible() || !c.isValid()) return null;
          return toolbar.getActionGroup();
        })
        .toList();
    }
private @NotNull List<ActionGroup> collectActionGroups()