@NotNull MovementAvailability canMoveToStackTop(@NotNull DocumentReference reference, @NotNull Map<Integer, MutableActionChangeRange> rangesToMove) {
    UndoRedoList<ImmutableActionChangeRange> stack = getStack(reference);
    ImmutableActionChangeRange[] affected = getAffectedRanges(stack, rangesToMove);
    if (affected == null) {
      return MovementAvailability.ALREADY_MOVED;
    }
    return moveToEnd(affected, rangesToMove.keySet()) ? MovementAvailability.CAN_MOVE : MovementAvailability.CANNOT_MOVE;
  }
@NotNull MovementAvailability canMoveToStackTop(@NotNull DocumentReference reference, @NotNull Map<Integer, MutableActionChangeRange> rangesToMove)