public Set<HttpMethod> allowedMethods(String uri) {
        QueryStringDecoder decoder = new QueryStringDecoder(uri);
        String[] tokens = PathPattern.removeSlashesAtBothEnds(decoder.path()).split("/");

        if (anyMethodRouter.anyMatched(tokens)) {
            return allAllowedMethods();
        }

        Set<HttpMethod> ret = new HashSet<HttpMethod>(routers.size());
        for (Map.Entry<HttpMethod, MethodlessRouter<T>> entry : routers.entrySet()) {
            MethodlessRouter<T> router = entry.getValue();
            if (router.anyMatched(tokens)) {
                HttpMethod method = entry.getKey();
                ret.add(method);
            }
        }

        return ret;
    }
@Test
    void testAllowedMethods() {
        assertThat(router.allAllowedMethods()).hasSize(9);

        Set<HttpMethod> methods = router.allowedMethods("/articles");
        assertThat(methods).hasSize(2);
        assertThat(methods.contains(GET)).isTrue();
        assertThat(methods.contains(POST)).isTrue();
    }