public static boolean isAsync(URL url, Invocation inv) {
        boolean isAsync;

        if (inv instanceof RpcInvocation) {
            RpcInvocation rpcInvocation = (RpcInvocation) inv;
            if (rpcInvocation.getInvokeMode() != null) {
                return rpcInvocation.getInvokeMode() == InvokeMode.ASYNC;
            }
        }

        if (Boolean.TRUE.toString().equals(inv.getAttachment(ASYNC_KEY))) {
            isAsync = true;
        } else {
            isAsync = url.getMethodParameter(getMethodName(inv), ASYNC_KEY, false);
        }
        return isAsync;
    }
@Test
    void testIsAsync() {
        Object[] args = new Object[] {"hello", "dubbo", 520};
        Class<?> demoServiceClass = DemoService.class;
        String serviceName = demoServiceClass.getName();
        Invoker invoker = createMockInvoker();

        URL url = URL.valueOf(
                "test://127.0.0.1:1/org.apache.dubbo.rpc.support.DemoService?interface=org.apache.dubbo.rpc.support.DemoService");

        RpcInvocation inv = new RpcInvocation(
                "test",
                serviceName,
                "",
                new Class<?>[] {String.class, String[].class, Object[].class},
                new Object[] {"method", new String[] {}, args},
                null,
                invoker,
                null);

        Assertions.assertFalse(RpcUtils.isAsync(url, inv));
        inv.setInvokeMode(InvokeMode.ASYNC);
        Assertions.assertTrue(RpcUtils.isAsync(url, inv));
    }