code: private static <T> int binarySearch0(Sortable<T> a, int fromIndex, int toIndex, T key, Comparator<? super T> c) {
          if (c == null) {
              throw new NullPointerException();
          }
          int low = fromIndex;
          int high = toIndex - 1;
  
          while (low <= high) {
              int mid = (low + high) >>> 1;
              T midVal = a.at(mid);
              int cmp = c.compare(midVal, key);
              if (cmp < 0)
                  low = mid + 1;
              else if (cmp > 0)
                  high = mid - 1;
              else
                  return mid; // key found
          }
          return -(low + 1); // key not found.
      }
docs: Like public version, but without range checks.