code: @SuppressWarnings("unchecked")
    static <T> void processFullBaseBuffer(final ItemsSketch<T> sketch) {
      final int bbCount = sketch.getBaseBufferCount();
      final long n = sketch.getN();
      assert bbCount == (2 * sketch.getK()); // internal consistency check
  
      // make sure there will be enough levels for the propagation
      ItemsUpdateImpl.maybeGrowLevels(sketch, n); // important: n_ was incremented by update before we got here
  
      // this aliasing is a bit dangerous; notice that we did it after the possible resizing
      final Object[] baseBuffer = sketch.getCombinedBuffer();
  
      Arrays.sort((T[]) baseBuffer, 0, bbCount, sketch.getComparator());
      ItemsUpdateImpl.inPlacePropagateCarry(
          0,
          null, 0,  // this null is okay
          (T[]) baseBuffer, 0,
          true, sketch);
      sketch.baseBufferCount_ = 0;
      Arrays.fill(baseBuffer, 0, 2 * sketch.getK(), null); // to release the discarded objects
      assert (n / (2L * sketch.getK())) == sketch.getBitPattern();  // internal consistency check
    }
docs: Called when the base buffer has just acquired 2*k elements.
  @param <T> the data type
  @param sketch the given quantiles sketch