public static void collectAllActions(@NotNull DefaultActionGroup group, @NotNull ActionGroup actionGroup) {
    for (AnAction action : actionGroup.getChildren(null)) {
      if (action instanceof ActionGroup g && !g.isPopup()) {
        collectAllActions(group, g);
      }
      else {
        // add actions group popup as is
        group.add(action);
      }
    }
  }
public static void collectAllActions(@NotNull DefaultActionGroup group, @NotNull ActionGroup actionGroup)