public static AnnotatedServiceExtensions ofExceptionHandlersAndConverters(
            Iterable<?> exceptionHandlersAndConverters) {

        final Builder<RequestConverterFunction> requestConverters = ImmutableList.builder();
        final Builder<ResponseConverterFunction> responseConverters = ImmutableList.builder();
        final Builder<ExceptionHandlerFunction> exceptionHandlers = ImmutableList.builder();

        for (final Object o : exceptionHandlersAndConverters) {
            if (o instanceof RequestConverterFunction) {
                requestConverters.add((RequestConverterFunction) o);
            } else if (o instanceof ResponseConverterFunction) {
                responseConverters.add((ResponseConverterFunction) o);
            } else if (o instanceof ExceptionHandlerFunction) {
                exceptionHandlers.add((ExceptionHandlerFunction) o);
            } else {
                throw new IllegalArgumentException(o.getClass().getName() +
                                                   " is neither an exception handler nor a converter.");
            }
        }

        return new AnnotatedServiceExtensions(requestConverters.build(), responseConverters.build(),
                                              exceptionHandlers.build());
    }
Creates a new instance with the specified {@code exceptionHandlersAndConverters}.
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedServiceExtensions.java