@Test
    void duplicatePathWithHeaders() {
        // Duplicate if supported methods overlap.
        testDuplicateRoutes(Route.builder().path("/foo").methods(HttpMethod.GET).build(),
                            Route.builder().path("/foo").methods(HttpMethod.GET, HttpMethod.POST).build());

        // Duplicate if supported methods overlap.
        testDuplicateRoutes(Route.builder().path("/foo").build(), // This route contains all methods.
                            Route.builder().path("/foo").methods(HttpMethod.GET).build());

        testNonDuplicateRoutes(Route.builder().path("/foo").methods(HttpMethod.GET).build(),
                               Route.builder().path("/foo").methods(HttpMethod.POST).build());

        // Duplicate if consume types overlap.
        testDuplicateRoutes(Route.builder()
                                 .path("/foo")
                                 .methods(HttpMethod.POST)
                                 .consumes(MediaType.PLAIN_TEXT_UTF_8, MediaType.JSON_UTF_8)
                                 .build(),
                            Route.builder()
                                 .path("/foo")
                                 .methods(HttpMethod.POST)
                                 .consumes(MediaType.JSON_UTF_8)
                                 .build());

        testNonDuplicateRoutes(Route.builder()
                                    .path("/foo")
                                    .methods(HttpMethod.POST)
                                    .consumes(MediaType.PLAIN_TEXT_UTF_8)
                                    .build(),
                               Route.builder()
                                    .path("/foo")
                                    .methods(HttpMethod.POST)
                                    .consumes(MediaType.JSON_UTF_8)
                                    .build());

        // Duplicate if produce types overlap.
        testDuplicateRoutes(Route.builder()
                                 .path("/foo")
                                 .methods(HttpMethod.POST)
                                 .produces(MediaType.PLAIN_TEXT_UTF_8, MediaType.JSON_UTF_8)
                                 .build(),
                            Route.builder()
                                 .path("/foo")
                                 .methods(HttpMethod.POST)
                                 .produces(MediaType.PLAIN_TEXT_UTF_8)
                                 .build());

        testNonDuplicateRoutes(Route.builder()
                                    .path("/foo")
                                    .methods(HttpMethod.POST)
                                    .produces(MediaType.PLAIN_TEXT_UTF_8)
                                    .build(),
                               Route.builder()
                                    .path("/foo")
                                    .methods(HttpMethod.POST)
                                    .produces(MediaType.JSON_UTF_8)
                                    .build());
    }
Should detect the duplicates even if the mappings are split into more than one router.
core/src/test/java/com/linecorp/armeria/server/RouterTest.java