code: public void addActionsToActionStateExecutionListAt(final Flow flow, final String actionStateId, final int position, final EvaluateAction... actions) {
          val actionState = getState(flow, actionStateId, ActionState.class);
          val currentActions = new ArrayList<Action>();
          val actionList = actionState.getActionList();
          actionList.forEach(currentActions::add);
          val index = position < 0 || position == Integer.MAX_VALUE ? currentActions.size() : position;
          currentActions.forEach(actionList::remove);
          Arrays.stream(actions).forEach(a -> currentActions.add(index, a));
          actionList.addAll(currentActions.toArray(Action[]::new));
      }
docs: Add actions to action state execution list at.
  
  @param flow          the flow
  @param actionStateId the action state id
  @param position      the position
  @param actions       the actions