private boolean addToSortedList(@NotNull AnAction action,
                                  @NotNull Constraints constraint,
                                  @NotNull Function<@NotNull AnAction, @Nullable String> actionToId) {
    String relativeToActionId = constraint.myRelativeToActionId;
    int index = relativeToActionId == null ? -1 : findIndex(relativeToActionId, mySortedChildren, actionToId);
    if (index == -1) {
      return false;
    }

    if (constraint.myAnchor == Anchor.BEFORE) {
      mySortedChildren.add(index, action);
    }
    else {
      mySortedChildren.add(index + 1, action);
    }
    return true;
  }
private boolean addToSortedList(@NotNull AnAction action,
                                  @NotNull Constraints constraint,
                                  @NotNull Function<@NotNull AnAction, @Nullable String> actionToId)