### Question:
AbstractInterfaceConfig extends AbstractMethodConfig { protected URL loadMonitor(URL registryURL) { checkMonitor(); Map<String, String> map = new HashMap<String, String>(); map.put(Constants.INTERFACE_KEY, MonitorService.class.getName()); appendRuntimeParameters(map); String hostToRegistry = ConfigUtils.getSystemProperty(Constants.DUBBO_IP_TO_REGISTRY); if (StringUtils.isEmpty(hostToRegistry)) { hostToRegistry = NetUtils.getLocalHost(); } else if (NetUtils.isInvalidLocalHost(hostToRegistry)) { throw new IllegalArgumentException("Specified invalid registry ip from property:" + Constants.DUBBO_IP_TO_REGISTRY + ", value:" + hostToRegistry); } map.put(Constants.REGISTER_IP_KEY, hostToRegistry); appendParameters(map, monitor); appendParameters(map, application); String address = monitor.getAddress(); String sysaddress = System.getProperty("dubbo.monitor.address"); if (sysaddress != null && sysaddress.length() > 0) { address = sysaddress; } if (ConfigUtils.isNotEmpty(address)) { if (!map.containsKey(Constants.PROTOCOL_KEY)) { if (getExtensionLoader(MonitorFactory.class).hasExtension("logstat")) { map.put(Constants.PROTOCOL_KEY, "logstat"); } else { map.put(Constants.PROTOCOL_KEY, Constants.DOBBO_PROTOCOL); } } return UrlUtils.parseURL(address, map); } else if (Constants.REGISTRY_PROTOCOL.equals(monitor.getProtocol()) && registryURL != null) { return registryURL.setProtocol(Constants.DOBBO_PROTOCOL).addParameter(Constants.PROTOCOL_KEY, Constants.REGISTRY_PROTOCOL).addParameterAndEncoded(Constants.REFER_KEY, StringUtils.toQueryString(map)); } return null; }  @Deprecated String getLocal(); @Deprecated void setLocal(Boolean local); @Deprecated void setLocal(String local); String getStub(); void setStub(Boolean stub); void setStub(String stub); String getCluster(); void setCluster(String cluster); String getProxy(); void setProxy(String proxy); Integer getConnections(); void setConnections(Integer connections); @Parameter(key = Constants.REFERENCE_FILTER_KEY, append = true) String getFilter(); void setFilter(String filter); @Parameter(key = Constants.INVOKER_LISTENER_KEY, append = true) String getListener(); void setListener(String listener); String getLayer(); void setLayer(String layer); ApplicationConfig getApplication(); void setApplication(ApplicationConfig application); ModuleConfig getModule(); void setModule(ModuleConfig module); RegistryConfig getRegistry(); void setRegistry(RegistryConfig registry); List<RegistryConfig> getRegistries(); @SuppressWarnings({"unchecked"}) void setRegistries(List<? extends RegistryConfig> registries); @Parameter(excluded = true) String getRegistryIds(); void setRegistryIds(String registryIds); MonitorConfig getMonitor(); void setMonitor(String monitor); void setMonitor(MonitorConfig monitor); String getOwner(); void setOwner(String owner); RegistryDataConfig getRegistryDataConfig(); void setRegistryDataConfig(RegistryDataConfig registryDataConfig); Integer getCallbacks(); void setCallbacks(Integer callbacks); String getOnconnect(); void setOnconnect(String onconnect); String getOndisconnect(); void setOndisconnect(String ondisconnect); String getScope(); void setScope(String scope); MetadataReportConfig getMetadataReportConfig(); void setMetadataReportConfig(MetadataReportConfig metadataReportConfig);  }### Answer:
@Test public void testLoadMonitor() { System.setProperty("dubbo.monitor.address", "monitor-addr:12080"); System.setProperty("dubbo.monitor.protocol", "monitor"); InterfaceConfig interfaceConfig = new InterfaceConfig(); URL url = interfaceConfig.loadMonitor(new URL("dubbo", "addr1", 9090)); Assertions.assertEquals("monitor-addr:12080", url.getAddress()); Assertions.assertEquals(MonitorService.class.getName(), url.getParameter("interface")); Assertions.assertNotNull(url.getParameter("dubbo")); Assertions.assertNotNull(url.getParameter("pid")); Assertions.assertNotNull(url.getParameter("timestamp")); }