private static List<Route> routes(Method method, Class<?> clazz, String pathPrefix) {
        final Set<Annotation> methodAnnotations = httpMethodAnnotations(method);
        if (methodAnnotations.isEmpty()) {
            throw new IllegalArgumentException("HTTP Method specification is missing: " + method.getName());
        }
        final Map<HttpMethod, List<String>> httpMethodPatternsMap =
                getHttpMethodPatternsMap(method, methodAnnotations);
        final String computedPathPrefix = computePathPrefix(clazz, pathPrefix);
        final Set<MediaType> consumableMediaTypes = consumableMediaTypes(method, clazz);
        final Set<MediaType> producibleMediaTypes = producibleMediaTypes(method, clazz);
        return httpMethodPatternsMap.entrySet().stream().flatMap(
                pattern -> {
                    final HttpMethod httpMethod = pattern.getKey();
                    final List<String> pathMappings = pattern.getValue();
                    return pathMappings.stream().map(
                            pathMapping -> Route.builder()
                                                .path(computedPathPrefix, pathMapping)
                                                .methods(httpMethod)
                                                .consumes(consumableMediaTypes)
                                                .produces(producibleMediaTypes)
                                                .matchesParams(
                                                        predicates(method, clazz, MatchesParam.class,
                                                                   MatchesParam::value))
                                                .matchesHeaders(
                                                        predicates(method, clazz, MatchesHeader.class,
                                                                   MatchesHeader::value))
                                                .build());
                }).collect(toImmutableList());
    }
Returns a list of {@link AnnotatedService} instances. A single {@link AnnotatedService} is
created per each {@link Route} associated with the {@code method}.
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedServiceFactory.java