### Question:
DubboMonitorFactory extends AbstractMonitorFactory { @Override protected Monitor createMonitor(URL url) { url = url.setProtocol(url.getParameter(Constants.PROTOCOL_KEY, "dubbo")); if (StringUtils.isEmpty(url.getPath())) { url = url.setPath(MonitorService.class.getName()); } String filter = url.getParameter(Constants.REFERENCE_FILTER_KEY); if (StringUtils.isEmpty(filter)) { filter = ""; } else { filter = filter + ","; } url = url.addParameters(Constants.CLUSTER_KEY, "failsafe", Constants.CHECK_KEY, String.valueOf(false), Constants.REFERENCE_FILTER_KEY, filter + "-monitor"); Invoker<MonitorService> monitorInvoker = protocol.refer(MonitorService.class, url); MonitorService monitorService = proxyFactory.getProxy(monitorInvoker); return new DubboMonitor(monitorInvoker, monitorService); }  void setProtocol(Protocol protocol); void setProxyFactory(ProxyFactory proxyFactory);  }### Answer:
@Test public void testCreateMonitor() { URL urlWithoutPath = URL.valueOf("http: Monitor monitor = dubboMonitorFactory.createMonitor(urlWithoutPath); assertThat(monitor, not(nullValue())); URL urlWithFilterKey = URL.valueOf("http: monitor = dubboMonitorFactory.createMonitor(urlWithFilterKey); assertThat(monitor, not(nullValue())); ArgumentCaptor<Invoker> invokerArgumentCaptor = ArgumentCaptor.forClass(Invoker.class); verify(proxyFactory, atLeastOnce()).getProxy(invokerArgumentCaptor.capture()); Invoker invoker = invokerArgumentCaptor.getValue(); assertThat(invoker.getUrl().getParameter(Constants.REFERENCE_FILTER_KEY), containsString("testFilter")); }