docs: @SuppressWarnings("unchecked")
    static <T> void mergeInto(final ItemsSketch<T> src, final ItemsSketch<T> tgt) {
      final int srcK = src.getK();
      final int tgtK = tgt.getK();
      final long srcN = src.getN();
      final long tgtN = tgt.getN();
  
      if (srcK != tgtK) {
        downSamplingMergeInto(src, tgt);
        return;
      }
      //The remainder of this code is for the case where the k's are equal
  
      final Object[] srcCombBuf     = src.getCombinedBuffer();
      final long nFinal = tgtN + srcN;
  
      for (int i = 0; i < src.getBaseBufferCount(); i++) { //update only the base buffer
        tgt.update((T) srcCombBuf[i]);
      }
  
      ItemsUpdateImpl.maybeGrowLevels(tgt, nFinal);
  
      final Object[] scratchBuf = new Object[2 * tgtK];
  
      long srcBitPattern = src.getBitPattern();
      assert srcBitPattern == (srcN / (2L * srcK));
  
      for (int srcLvl = 0; srcBitPattern != 0L; srcLvl++, srcBitPattern >>>= 1) {
        if ((srcBitPattern & 1L) > 0L) { //only one level above base buffer
          ItemsUpdateImpl.inPlacePropagateCarry(
              srcLvl,
              (T[]) srcCombBuf, (2 + srcLvl) * tgtK,
              (T[]) scratchBuf, 0,
              false,
              tgt);
        // won't update tgt.n_ until the very end
        }
      }
      tgt.n_ = nFinal;
  
      assert (tgt.getN() / (2L * tgtK)) == tgt.getBitPattern(); // internal consistency check
  
      final T srcMax = src.getMaxValue();
      final T srcMin = src.getMinValue();
      final T tgtMax = tgt.getMaxValue();
      final T tgtMin = tgt.getMinValue();
  
      if ((srcMax != null) && (tgtMax != null)) {
        tgt.maxValue_ = (src.getComparator().compare(srcMax, tgtMax) > 0) ? srcMax : tgtMax;
      } //only one could be null
      else if (tgtMax == null) { //if srcMax were null we would leave tgt alone
        tgt.maxValue_ = srcMax;
      }
  
      if ((srcMin != null) && (tgtMin != null)) {
        tgt.minValue_ = (src.getComparator().compare(srcMin, tgtMin) > 0) ? tgtMin : srcMin;
      } //only one could be null
      else if (tgtMin == null) { //if srcMin were null we would leave tgt alone
        tgt.minValue_ = srcMin;
      }
    }