public ProviderGroup addAll(Collection<ProviderInfo> providerInfos) {
        if (CommonUtils.isEmpty(providerInfos)) {
            return this;
        }
        ConcurrentHashSet<ProviderInfo> tmp = new ConcurrentHashSet<ProviderInfo>(this.providerInfos);
        tmp.addAll(providerInfos); // 排重
        this.providerInfos = new ArrayList<ProviderInfo>(tmp);
        return this;
    }
@Test
    public void addAll() throws Exception {
        ProviderGroup pg = new ProviderGroup("xxx", null);
        Assert.assertTrue(pg.size() == 0);

        pg.addAll(null);
        Assert.assertTrue(pg.size() == 0);

        pg.addAll(new ArrayList<ProviderInfo>());
        Assert.assertTrue(pg.size() == 0);

        pg.addAll(Arrays.asList(ProviderHelper.toProviderInfo("127.0.0.1:12200"),
            ProviderHelper.toProviderInfo("127.0.0.1:12201")));
        Assert.assertTrue(pg.size() == 2);

        pg.addAll(Collections.singleton(ProviderHelper.toProviderInfo("127.0.0.1:12202")));
        Assert.assertTrue(pg.size() == 3);

        // 重复
        pg.addAll(Arrays.asList(ProviderHelper.toProviderInfo("127.0.0.1:12201"),
            ProviderHelper.toProviderInfo("127.0.0.1:12203")));
        Assert.assertTrue(pg.size() == 4);

        // 重复
        pg.addAll(Arrays.asList(ProviderHelper.toProviderInfo("127.0.0.1:12201"),
            ProviderHelper.toProviderInfo("127.0.0.1:12202")));
        Assert.assertTrue(pg.size() == 4);
    }