List<ProviderInfo> mergeProviderInfo(List<String> userDatas, List<String> configDatas) {
        // 是否自己缓存运算后的结果？？ TODO
        List<ProviderInfo> providers = SofaRegistryHelper.parseProviderInfos(userDatas);
        // 交叉比较
        if (CommonUtils.isNotEmpty(providers) && CommonUtils.isNotEmpty(configDatas)) {
            List<ProviderInfo> override = SofaRegistryHelper.parseProviderInfos(configDatas);
            Iterator<ProviderInfo> iterator = providers.iterator();
            while (iterator.hasNext()) {
                ProviderInfo origin = iterator.next();
                for (ProviderInfo over : override) {
                    if (PROTOCOL_TYPE_OVERRIDE.equals(over.getProtocolType()) &&
                        StringUtils.equals(origin.getHost(), over.getHost()) && origin.getPort() == over.getPort()) {
                        // host 和 port 相同 认为是一个地址
                        if (over.getWeight() != origin.getWeight()) {
                            origin.setWeight(over.getWeight());
                        }
                        if (CommonUtils.isTrue(over.getAttr(ProviderInfoAttrs.ATTR_DISABLED))) {
                            if (LOGGER.isInfoEnabled()) {
                                LOGGER.info("Provider is disabled by override. {}", origin.toUrl());
                            }
                            iterator.remove(); // 禁用 删掉
                        }
                    }
                }
            }
        }
        return providers;
    }
@Test
    public void mergeProviderInfo() throws Exception {
        SofaRegistrySubscribeCallback callback = new SofaRegistrySubscribeCallback();
        // null + null
        List<ProviderInfo> result = callback.mergeProviderInfo(null, null);
        Assert.assertTrue(CommonUtils.isEmpty(result));
        // 空 + null
        List<String> listData = new ArrayList<String>();
        result = callback.mergeProviderInfo(listData, null);
        Assert.assertTrue(CommonUtils.isEmpty(result));
        // null + 空
        List<String> attrData = new ArrayList<String>();
        result = callback.mergeProviderInfo(null, attrData);
        Assert.assertTrue(CommonUtils.isEmpty(result));
        // 空+ 空
        result = callback.mergeProviderInfo(listData, attrData);
        Assert.assertTrue(CommonUtils.isEmpty(result));
        // 空+非空
        attrData.add("override://127.0.0.1?weight=200");
        result = callback.mergeProviderInfo(listData, attrData);
        Assert.assertTrue(CommonUtils.isEmpty(result));
        // 非空+空
        attrData.clear();
        listData.add("127.0.0.1:22000?weight=100");
        listData.add("127.0.0.1:22001?weight=100");
        result = callback.mergeProviderInfo(listData, attrData);
        Assert.assertTrue(result.size() == 2);
        for (ProviderInfo providerInfo : result) {
            if (providerInfo.getPort() == 22000) {
                Assert.assertTrue(providerInfo.getWeight() == 100);
            } else if (providerInfo.getPort() == 22001) {
                Assert.assertTrue(providerInfo.getWeight() == 100);
            }
        }
        // 覆盖未命中
        attrData.add("override://127.0.0.1:22005?weight=200");
        attrData.add("override://127.0.0.1:22004?disabled=true&weight=200");
        result = callback.mergeProviderInfo(listData, attrData);
        Assert.assertTrue(result.size() == 2);
        for (ProviderInfo providerInfo : result) {
            if (providerInfo.getPort() == 22000) {
                Assert.assertTrue(providerInfo.getWeight() == 100);
            } else if (providerInfo.getPort() == 22001) {
                Assert.assertTrue(providerInfo.getWeight() == 100);
            }
        }
        // 覆盖
        attrData.add("override://127.0.0.1:22000?weight=200");
        attrData.add("override://127.0.0.1:22001?disabled=true&weight=200");
        result = callback.mergeProviderInfo(listData, attrData);
        Assert.assertTrue(result.size() == 1);
        for (ProviderInfo providerInfo : result) {
            if (providerInfo.getPort() == 22000) {
                Assert.assertTrue(providerInfo.getWeight() == 200);
            }
        }
    }