public static int binarySearch(int fromIndex, int toIndex, @NotNull IntUnaryOperator indexComparator) {
    int low = fromIndex;
    int high = toIndex - 1;
    while (low <= high) {
      int mid = (low + high) >>> 1;
      int cmp = indexComparator.applyAsInt(mid);
      if (cmp < 0) low = mid + 1;
      else if (cmp > 0) high = mid - 1;
      else return mid;
    }
    return -(low + 1);
  }
public static int binarySearch(int fromIndex, int toIndex, @NotNull IntUnaryOperator indexComparator)