List<Action> (@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; }