public static @NotNull List<AnAction> collectActions(@Nullable JComponent component) {
    JBIterable<ActionToolbar> toolbars = UIUtil.uiTraverser(component).traverse().filter(ActionToolbar.class);
    if (toolbars.isEmpty()) {
      return Collections.emptyList();
    }
    return toolbars.flatten(ActionToolbar::getActions).toList();
  }
public static @NotNull List<AnAction> collectActions(@Nullable JComponent component)