@Test
    public void removeKeys() throws Exception {

        SofaRegistryHelper.removeOldKeys(null);
        SofaRegistryHelper.removeOldKeys(null, null);

        Map<String, String> map = new HashMap<String, String>();
        SofaRegistryHelper.removeOldKeys(map, null);

        map.put("11", "aa");
        map.put("22", "bb");
        map.put("33", "cc");

        SofaRegistryHelper.removeOldKeys(map);
        Assert.assertEquals(map.size(), 3);
        SofaRegistryHelper.removeOldKeys(map, "xx");
        Assert.assertEquals(map.size(), 3);
        SofaRegistryHelper.removeOldKeys(map, "xx", "yy");
        Assert.assertEquals(map.size(), 3);
        SofaRegistryHelper.removeOldKeys(map, "11");
        Assert.assertEquals(map.size(), 2);
        SofaRegistryHelper.removeOldKeys(map, "22", "33");
        Assert.assertEquals(map.size(), 0);

        map.put("11", "aa");
        map.put("22", "bb");
        map.put("33", "cc");

        Assert.assertEquals(SofaRegistryHelper.getValue(map), null);
        Assert.assertEquals(SofaRegistryHelper.getValue(map, "xx"), null);
        Assert.assertEquals(SofaRegistryHelper.getValue(map, "yy", "zz"), null);
        Assert.assertEquals(SofaRegistryHelper.getValue(map, "zz", "11"), "aa");
        Assert.assertEquals(SofaRegistryHelper.getValue(map, "11", "22"), "aa");
        Assert.assertEquals(SofaRegistryHelper.getValue(map, "22", "33"), "bb");
    }
Created by zhanggeng on 2017/7/13.

@author <a href="mailto:zhanggeng.zg@antfin.com">zhanggeng</a>
registry/registry-sofa/src/test/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistryHelperTest.java