private ServiceInfo addServiceExamples(ServiceInfo service) {
        final ListMultimap<String, HttpHeaders> exampleHeaders =
                this.exampleHeaders.getOrDefault(service.name(), ImmutableListMultimap.of());
        final ListMultimap<String, String> exampleRequests =
                this.exampleRequests.getOrDefault(service.name(), ImmutableListMultimap.of());
        final ListMultimap<String, String> examplePaths =
                this.examplePaths.getOrDefault(service.name(), ImmutableListMultimap.of());
        final ListMultimap<String, String> exampleQueries =
                this.exampleQueries.getOrDefault(service.name(), ImmutableListMultimap.of());

        final List<MethodInfo> methodsWithExamples =
                service.methods().stream()
                       .map(m -> new MethodInfo(
                               m.name(), m.returnTypeSignature(), m.parameters(), m.useParameterAsRoot(),
                               m.exceptionTypeSignatures(),
                               m.endpoints(), concatAndDedup(exampleHeaders.get(m.name()), m.exampleHeaders()),
                               // Show the examples added via `DocServiceBuilder` before the examples
                               // generated by the plugin.
                               concatAndDedup(exampleRequests.get(m.name()), m.exampleRequests()),
                               concatAndDedup(examplePaths.get(m.name()), m.examplePaths()),
                               concatAndDedup(exampleQueries.get(m.name()), m.exampleQueries()), m.httpMethod(),
                               m.descriptionInfo(), m.id()
                       ))
                       .collect(toImmutableList());
        final Iterable<HttpHeaders> serviceExampleHeaders =
                Iterables.concat(service.exampleHeaders(), exampleHeaders.get(""));

        return service.withMethods(methodsWithExamples)
                      .withExampleHeaders(serviceExampleHeaders);
    }
Adds examples to the {@link ServiceSpecification} and {@link ServiceInfo} objects.
@param spec Spec itself.
@return new {@link ServiceSpecification} with examples.
core/src/main/java/com/linecorp/armeria/server/docs/ExampleSupport.java