docs: @Override
    public void merge(MergeState mergeState) throws IOException {
      final List<Fields> fields = new ArrayList<>();
      final List<ReaderSlice> slices = new ArrayList<>();
  
      int docBase = 0;
  
      for (int readerIndex = 0; readerIndex < mergeState.fieldsProducers.length; readerIndex++) {
        final FieldsProducer f = mergeState.fieldsProducers[readerIndex];
  
        final int maxDoc = mergeState.maxDocs[readerIndex];
        f.checkIntegrity();
        slices.add(new ReaderSlice(docBase, maxDoc, readerIndex));
        fields.add(f);
        docBase += maxDoc;
      }
  
      Fields mergedFields = new MappedMultiFields(mergeState,
          new MultiFields(fields.toArray(Fields.EMPTY_ARRAY),
              slices.toArray(ReaderSlice.EMPTY_ARRAY)));
      write(mergedFields);
    }