public <T extends CodeWriter> DocumentationWriter<T> build() {
        Function<String, String> function = resolveMappingFunction();
        String sectionName = namedDocumentationSection;

        return (writer, runnable) -> {
            if (sectionName != null) {
                writer.pushState(sectionName);
            }

            writer.pushFilteredState(function);
            writer.writeWithNoFormatting("/**");
            writer.setNewlinePrefix(" * ");
            runnable.run();
            writer.ensureNewline();
            writer.popState();
            writer.writeWithNoFormatting(" */");

            if (sectionName != null) {
                writer.popState();
            }
        };
    }
Creates a {@code DocumentationWriter} configured by the builder.

@param <T> The type of writer to create.
@return Returns the created documentation writer.
smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/writer/JavaStyleDocumentationWriterBuilder.java