private static @NotNull List<Action> flattenOptionsActions(@NotNull List<? extends Action> actions) {
    List<Action> newActions = new ArrayList<>();
    for (Action action : actions) {
      newActions.add(action);
      if (action instanceof OptionAction it) {
        for (Action option : it.getOptions()) {
          option.putValue(MAC_ACTION_ORDER, action.getValue(DEFAULT_ACTION) != null ? DEFAULT_ACTION_ORDER - 1 : 0);
          newActions.add(option);
        }
      }
    }
    return newActions;
  }
private static @NotNull List<Action> flattenOptionsActions(@NotNull List<? extends Action> actions)