public void setContainerLastActions(List<ActionItem> lastActions) {
    removeContainerLastActions();

    for (ActionItem lastAction : lastActions) {
      lastAction.ensureLastActionOf().add(this);
    }

    containerLastActions = lastActions;
  }
  public void setJumpTarget(ActionItem item) {
    removeJumpTarget();

    if (item == null) {
      return;
    }

    if (item.jumpsHere == null) {
      item.jumpsHere = new HashSet<>();
    }

    item.jumpsHere.add(this);
    jumpTarget = item;
  }
  public void replaceContainerLastAction(ActionItem oldItem, ActionItem newItem) {
    if (containerLastActions == null) {
      return;
    }

    for (int i = 0; i < containerLastActions.size(); i++) {
      if (containerLastActions.get(i) == oldItem) {
        containerLastActions.set(i, newItem);
        if (oldItem.lastActionOf != null) {
          oldItem.lastActionOf.remove(this);
        }

        newItem.ensureLastActionOf().add(this);
      }
    }
  }