public static boolean isReturnTypeFuture(Invocation inv) {
        Class<?> clazz;
        if (inv instanceof RpcInvocation) {
            clazz = ((RpcInvocation) inv).getReturnType();
        } else {
            clazz = getReturnType(inv);
        }
        return (clazz != null && CompletableFuture.class.isAssignableFrom(clazz)) || isGenericAsync(inv);
    }
@Test
    void testIsReturnTypeFuture() {
        Class<?> demoServiceClass = DemoService.class;
        String serviceName = demoServiceClass.getName();
        Invoker invoker = createMockInvoker(
                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(
                "testReturnType", serviceName, "", new Class<?>[] {String.class}, null, null, invoker, null);
        Assertions.assertFalse(RpcUtils.isReturnTypeFuture(inv));

        ModuleServiceRepository repository =
                ApplicationModel.defaultModel().getDefaultModule().getServiceRepository();
        repository.registerService(demoServiceClass);

        inv = new RpcInvocation(
                "testReturnType4", serviceName, "", new Class<?>[] {String.class}, null, null, invoker, null);
        Assertions.assertTrue(RpcUtils.isReturnTypeFuture(inv));
    }