### Question:
ServiceBootstrap { public static Map<String, String> parseRegistryCfg(String registryCfg) { if (StringUtils.isBlank(registryCfg)) { return Collections.emptyMap(); } Map<String, String> registryInfo = new HashMap<>(); String[] cfgs = registryCfg.split(": String registryWay = cfgs[0]; registryInfo.put(Constants.REGISTRY_WAY_KEY, registryWay); if (cfgs.length >= 2) { String addressParams = cfgs[1]; String[] paramCfgs = addressParams.split("\\?"); String registryAddress = paramCfgs[0]; Map<String, String> attachments = Collections.emptyMap(); if (paramCfgs.length > 1) { attachments = CommonUtil.parseUrlParams(paramCfgs[1]); } registryInfo.put(Constants.REGISTRY_ADDRESS_KEY, registryAddress); registryInfo.putAll(attachments); } return registryInfo; }  synchronized static void initHttpServer(RpcRole role); static HttpServer getHttpServer(); static Map<String, String> parseRegistryCfg(String registryCfg);  }### Answer:
@Test public void testParseRegistryCfg() { Map<String, String> registryInfo = ServiceBootstrap.parseRegistryCfg(registry1); Assert.assertEquals(1, registryInfo.size()); Assert.assertEquals("mns", registryInfo.get(Constants.REGISTRY_WAY_KEY)); registryInfo = ServiceBootstrap.parseRegistryCfg(registry2); Assert.assertEquals(1, registryInfo.size()); Assert.assertEquals("mns", registryInfo.get(Constants.REGISTRY_WAY_KEY)); registryInfo = ServiceBootstrap.parseRegistryCfg(registry3); Assert.assertEquals(3, registryInfo.size()); Assert.assertEquals("mns", registryInfo.get(Constants.REGISTRY_WAY_KEY)); Assert.assertEquals("", registryInfo.get(Constants.REGISTRY_ADDRESS_KEY)); Assert.assertEquals("v1", registryInfo.get("k1")); registryInfo = ServiceBootstrap.parseRegistryCfg(registry4); Assert.assertEquals(2, registryInfo.size()); Assert.assertEquals("zookeeper", registryInfo.get(Constants.REGISTRY_WAY_KEY)); Assert.assertEquals("127.0.0.1:9000", registryInfo.get(Constants.REGISTRY_ADDRESS_KEY)); registryInfo = ServiceBootstrap.parseRegistryCfg(registry5); Assert.assertEquals(3, registryInfo.size()); Assert.assertEquals("zookeeper", registryInfo.get(Constants.REGISTRY_WAY_KEY)); Assert.assertEquals("127.0.0.1:9000", registryInfo.get(Constants.REGISTRY_ADDRESS_KEY)); Assert.assertEquals("v1", registryInfo.get("k1")); }