class ActionInvoker {

    public String execute(Action action) {
        action.execute();
        undoStack.push(action);
        redoStack.clear();

        listeners.forEach(listener -> listener.onActionExecuted(action));

        return action.getExecuteText();
    }

}