docs: private Pair<Integer, Integer> findLeafCombineDegreeAndNumBuffers(
        ByteBuffer combineBuffer,
        int requiredMinimumBufferCapacity,
        int numAvailableThreads,
        int numLeafNodes
    )
    {
      for (int leafCombineDegree = MINIMUM_LEAF_COMBINE_DEGREE; leafCombineDegree <= numLeafNodes; leafCombineDegree++) {
        final int requiredBufferNum = computeRequiredBufferNum(numLeafNodes, leafCombineDegree);
        if (requiredBufferNum <= numAvailableThreads) {
          final int expectedSliceSize = combineBuffer.capacity() / requiredBufferNum;
          if (expectedSliceSize >= requiredMinimumBufferCapacity) {
            return Pair.of(leafCombineDegree, requiredBufferNum);
          }
        }
      }
  
      throw new ISE(
          "Cannot find a proper leaf combine degree for the combining tree. "
          + "Each node of the combining tree requires a buffer of [%d] bytes. "
          + "Try increasing druid.processing.buffer.sizeBytes (currently [%d] bytes) for larger buffer or "
          + "druid.query.groupBy.intermediateCombineDegree for a smaller tree",
          requiredMinimumBufferCapacity,
          combineBuffer.capacity()
      );
    }