@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);
}