@Override
    public Result invoke(Invocation invocation) throws RpcException {
        // When broadcasting, it should be called remotely.
        if (isBroadcast()) {
            if (logger.isDebugEnabled()) {
                logger.debug("Performing broadcast call for method: " + RpcUtils.getMethodName(invocation)
                        + " of service: " + getUrl().getServiceKey());
            }
            return invoker.invoke(invocation);
        }
        if (peerFlag) {
            if (logger.isDebugEnabled()) {
                logger.debug("Performing point-to-point call for method: " + RpcUtils.getMethodName(invocation)
                        + " of service: " + getUrl().getServiceKey());
            }
            // If it's a point-to-point direct connection, invoke the original Invoker
            return invoker.invoke(invocation);
        }
        if (isInjvmExported()) {
            if (logger.isDebugEnabled()) {
                logger.debug("Performing local JVM call for method: " + RpcUtils.getMethodName(invocation)
                        + " of service: " + getUrl().getServiceKey());
            }
            // If it's exported to the local JVM, invoke the corresponding Invoker
            return injvmInvoker.invoke(invocation);
        }
        if (logger.isDebugEnabled()) {
            logger.debug("Performing remote call for method: " + RpcUtils.getMethodName(invocation) + " of service: "
                    + getUrl().getServiceKey());
        }
        // Otherwise, delegate the invocation to the original Invoker
        return invoker.invoke(invocation);
    }
@Test
    void testScopeNull_RemoteInvoke() {
        URL url = URL.valueOf("remote://1.2.3.4/" + DemoService.class.getName());
        url = url.addParameter(REFER_KEY, URL.encode(PATH_KEY + "=" + DemoService.class.getName()));
        url = url.setScopeModel(ApplicationModel.defaultModel().getDefaultModule());

        Invoker<DemoService> cluster = getClusterInvoker(url);
        invokers.add(cluster);

        // Configured with mock
        RpcInvocation invocation = new RpcInvocation();
        invocation.setMethodName("doSomething1");
        Result ret = cluster.invoke(invocation);
        Assertions.assertEquals("doSomething1", ret.getValue());
    }