code: private int binarySearch(int fromIndex, int toIndex, Composite name, Comparator<Composite> comparator)
      {
          int low = fromIndex;
          int mid = toIndex;
          int high = mid - 1;
          int result = -1;
          while (low <= high)
          {
              mid = (low + high) >> 1;
              if ((result = comparator.compare(name, cells[mid].name())) > 0)
                  low = mid + 1;
              else if (result == 0)
                  return mid;
              else
                  high = mid - 1;
          }
          return -mid - (result < 0 ? 1 : 2);
      }
docs: Simple binary search for a given cell name.
  The return value has the exact same meaning that the one of Collections.binarySearch().
  (We don't use Collections.binarySearch() directly because it would require us to create
  a fake Cell (as well as an Cell comparator) to do the search, which is ugly.