code: @Private static int binarySearch(IntList ascendingInts, int value) {
      for (int begin = 0, to = ascendingInts.size();;) {
        if (begin == to) return begin;
        int i = (begin + to) / 2;
        int x = ascendingInts.get(i);
        if (x == value) return i;
        else if (x > value) to = i;
        else begin = i + 1;
      }
    }
docs: Uses binary search to look up the index of the first element in {@code ascendingInts} that's
  greater than or equal to {@code value}. If all elements are smaller than {@code value},
  {@code ascendingInts.size()} is returned.