docs: @Override
    public long select(final long j) throws IllegalArgumentException {
      if (!doCacheCardinalities) {
        return selectNoCache(j);
      }
  
      // Ensure all cumulatives as we we have straightforward way to know in advance the high of the
      // j-th value
      int indexOk = ensureCumulatives(highestHigh());
  
      if (highToBitmap.isEmpty()) {
        return throwSelectInvalidIndex(j);
      }
  
      // Use normal binarySearch as cardinality does not depends on considering longs signed or
      // unsigned
      // We need sortedCumulatedCardinality not to contain duplicated, else binarySearch may return
      // any of the duplicates: we need to ensure it holds no high associated to an empty bitmap
      int position = Arrays.binarySearch(sortedCumulatedCardinality, 0, indexOk, j);
  
      if (position >= 0) {
        if (position == indexOk - 1) {
          // .select has been called on this.getCardinality
          return throwSelectInvalidIndex(j);
        }
  
        // There is a bucket leading to this cardinality: the j-th element is the first element of
        // next bucket
        int high = sortedHighs[position + 1];
        BitmapDataProvider nextBitmap = highToBitmap.get(high);
        return RoaringIntPacking.pack(high, nextBitmap.select(0));
      } else {
        // There is no bucket with this cardinality
        int insertionPoint = -position - 1;
  
        final long previousBucketCardinality;
        if (insertionPoint == 0) {
          previousBucketCardinality = 0L;
        } else if (insertionPoint >= indexOk) {
          return throwSelectInvalidIndex(j);
        } else {
          previousBucketCardinality = sortedCumulatedCardinality[insertionPoint - 1];
        }
  
        // We get a 'select' query for a single bitmap: should fit in an int
        final int givenBitmapSelect = (int) (j - previousBucketCardinality);
  
        int high = sortedHighs[insertionPoint];
        BitmapDataProvider lowBitmap = highToBitmap.get(high);
        int low = lowBitmap.select(givenBitmapSelect);
  
        return RoaringIntPacking.pack(high, low);
      }
    }