boolean matchWhen(URL url, Invocation invocation) {
        if (CollectionUtils.isEmptyMap(whenCondition)) {
            return true;
        }

        return doMatch(url, null, invocation, whenCondition, true);
    }
@Test
    void testRoute_methodRoute() {
        Invocation invocation = new RpcInvocation("getFoo", "com.foo.BarService", "", new Class<?>[0], new Object[0]);
        // More than one methods, mismatch
        StateRouter router = new ConditionStateRouterFactory()
                .getRouter(String.class, getRouteUrl("methods=getFoo => host = 1.2.3.4"));
        boolean matchWhen = ((ConditionStateRouter) router)
                .matchWhen(
                        URL.valueOf("consumer://1.1.1.1/com.foo.BarService?methods=setFoo,getFoo,findFoo"), invocation);
        Assertions.assertTrue(matchWhen);
        // Exactly one method, match
        matchWhen = ((ConditionStateRouter) router)
                .matchWhen(URL.valueOf("consumer://1.1.1.1/com.foo.BarService?methods=getFoo"), invocation);
        Assertions.assertTrue(matchWhen);
        // Method routing and Other condition routing can work together
        StateRouter router2 = new ConditionStateRouterFactory()
                .getRouter(String.class, getRouteUrl("methods=getFoo & host!=1.1.1.1 => host = 1.2.3.4"));
        matchWhen = ((ConditionStateRouter) router2)
                .matchWhen(URL.valueOf("consumer://1.1.1.1/com.foo.BarService?methods=getFoo"), invocation);
        Assertions.assertFalse(matchWhen);

        StateRouter router3 = new ConditionStateRouterFactory()
                .getRouter(String.class, getRouteUrl("methods=getFoo & host=1.1.1.1 => host = 1.2.3.4"));
        matchWhen = ((ConditionStateRouter) router3)
                .matchWhen(URL.valueOf("consumer://1.1.1.1/com.foo.BarService?methods=getFoo"), invocation);
        Assertions.assertTrue(matchWhen);
        // Test filter condition
        List<Invoker<String>> originInvokers = new ArrayList<Invoker<String>>();
        Invoker<String> invoker1 = new MockInvoker<String>(URL.valueOf("dubbo://10.20.3.3:20880/com.foo.BarService"));
        Invoker<String> invoker2 =
                new MockInvoker<String>(URL.valueOf("dubbo://" + LOCAL_HOST + ":20880/com.foo.BarService"));
        Invoker<String> invoker3 =
                new MockInvoker<String>(URL.valueOf("dubbo://" + LOCAL_HOST + ":20880/com.foo.BarService"));
        originInvokers.add(invoker1);
        originInvokers.add(invoker2);
        originInvokers.add(invoker3);
        BitList<Invoker<String>> invokers = new BitList<>(originInvokers);

        StateRouter router4 = new ConditionStateRouterFactory()
                .getRouter(
                        String.class,
                        getRouteUrl("host = " + LOCAL_HOST + " & methods = getFoo => " + " host = 10.20.3.3")
                                .addParameter(FORCE_KEY, String.valueOf(true)));
        List<Invoker<String>> filteredInvokers1 = router4.route(
                invokers.clone(),
                URL.valueOf("consumer://" + LOCAL_HOST + "/com.foo.BarService"),
                invocation,
                false,
                new Holder<>());
        Assertions.assertEquals(1, filteredInvokers1.size());

        StateRouter router5 = new ConditionStateRouterFactory()
                .getRouter(
                        String.class,
                        getRouteUrl("host = " + LOCAL_HOST + " & methods = unvalidmethod => " + " host = 10.20.3.3")
                                .addParameter(FORCE_KEY, String.valueOf(true)));
        List<Invoker<String>> filteredInvokers2 = router5.route(
                invokers.clone(),
                URL.valueOf("consumer://" + LOCAL_HOST + "/com.foo.BarService"),
                invocation,
                false,
                new Holder<>());
        Assertions.assertEquals(3, filteredInvokers2.size());
        // Request a non-exists method
    }