private static String[] guessAndSerializeExampleRequest(Object exampleRequest) {
        checkArgument(!(exampleRequest instanceof CharSequence),
                      "can't guess service or method name from a string: %s", exampleRequest);

        boolean guessed = false;
        for (DocServicePlugin plugin : DocService.plugins) {
            // Skip if the plugin does not support it.
            if (plugin.supportedExampleRequestTypes().stream()
                      .noneMatch(type -> type.isInstance(exampleRequest))) {
                continue;
            }

            final String serviceName = plugin.guessServiceName(exampleRequest);
            final String methodName = plugin.guessServiceMethodName(exampleRequest);

            // Skip if the plugin cannot guess the service and method name.
            if (serviceName == null || methodName == null) {
                continue;
            }

            guessed = true;
            final String serialized = plugin.serializeExampleRequest(serviceName, methodName, exampleRequest);
            if (serialized != null) {
                return new String[] { serviceName, methodName, serialized };
            }
        }

        if (guessed) {
            throw new IllegalArgumentException(
                    "could not find a plugin that can serialize: " + exampleRequest);
        } else {
            throw new IllegalArgumentException(
                    "could not find a plugin that can guess the service and method name from: " +
                    exampleRequest);
        }
    }
Returns a tuple of a service name, a method name and a serialized example request.
core/src/main/java/com/linecorp/armeria/server/docs/DocServiceBuilder.java