@Test
    void duplicateWithPredicates() {
        // Duplicate if matches params overlap.
        testDuplicateRoutes(Route.builder().path("/foo").methods(HttpMethod.POST)
                                 .matchesParams("a!=b||b=a", "foo")
                                 .build(),
                            Route.builder().path("/foo").methods(HttpMethod.POST)
                                 .matchesParams(" a!=b || b=a")
                                 .build());
        // Non-duplicate
        testNonDuplicateRoutes(Route.builder().path("/foo").methods(HttpMethod.POST)
                                 .matchesParams("a!=b||b=c")
                                 .build(),
                            Route.builder().path("/foo").methods(HttpMethod.POST)
                                 .matchesParams("a!=b||b=a")
                                 .build());
        // Non-duplicate even if matches params overlap when the custom predicate is specified.
        testNonDuplicateRoutes(Route.builder().path("/foo").methods(HttpMethod.POST)
                                    .matchesParams("foo", p -> true)
                                    .build(),
                               Route.builder().path("/foo").methods(HttpMethod.POST)
                                    .matchesParams("foo")
                                    .build());

        // Duplicate if matches headers overlap.
        testDuplicateRoutes(Route.builder().path("/foo").methods(HttpMethod.POST)
                                 .matchesHeaders("foo", "bar")
                                 .build(),
                            Route.builder().path("/foo").methods(HttpMethod.POST)
                                 .matchesHeaders("foo")
                                 .build());
        // Non-duplicate
        testNonDuplicateRoutes(Route.builder().path("/foo").methods(HttpMethod.POST)
                                    .matchesHeaders("foo")
                                    .build(),
                               Route.builder().path("/foo").methods(HttpMethod.POST)
                                    .matchesHeaders("foo1")
                                    .build());
        // Non-duplicate even if matches headers overlap when the custom predicate is specified.
        testNonDuplicateRoutes(Route.builder().path("/foo").methods(HttpMethod.POST)
                                    .matchesHeaders("foo", p -> true)
                                    .build(),
                               Route.builder().path("/foo").methods(HttpMethod.POST)
                                    .matchesHeaders("foo")
                                    .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