### Question:
InvokerRepository implements ProviderListener { @Override public synchronized void notify(List<Provider> providers) { if (providers == null || providers.isEmpty()) { logger.error("Provider list is empty, {}", subscribeInfo.toString()); } else { logger.info("Update providers, total {} providers", providers.size()); } Set<String> newAddresses = new HashSet<>(); for (Provider provider : providers) { String ip = provider.getIp(); int port = provider.getPort(); String address = ip + Constants.COLON + port; addOrUpdateInvokers(address, provider); newAddresses.add(address); } List<Invoker> unusedInvokers = findUnusedInvokers(newAddresses); refreshInvokers(); destroyUnusedInvokers(unusedInvokers); } InvokerRepository(ClientConfig clientCfg);  InvokerRepository(ClientConfig clientCfg, boolean isDirectConn); @Override synchronized void notify(List<Provider> providers); @Override void added(List<Provider> providers); @Override void updated(List<Provider> providers); @Override void removed(List<String> ipPorts); void destroy(); synchronized List<Invoker<T>> getInvokers(); void setSubscribeInfo(SubscribeInfo subscribeInfo); RegistryPolicy getRegistry(); void setRegistry(RegistryPolicy registry); Class<T> getServiceInterface(); ClientConfig getClientConfig(); boolean isDirectConn();  }### Answer:
@Test public void testNotify() { ClientConfig clientConfig = MockUtil.getClientConfig(); InvokerRepository invokerRepository = new InvokerRepository(clientConfig); Assert.assertEquals("mock", invokerRepository.getClientConfig().getProtocol()); Assert.assertNull(invokerRepository.getRegistry()); invokerRepository.notify(MockUtil.getProviderList()); Assert.assertTrue(invokerRepository.getInvokers().size() == 3); invokerRepository.setRegistry(new FailbackRegistry(new MockRegistry())); Assert.assertTrue(invokerRepository.getRegistry() instanceof FailbackRegistry); invokerRepository = new InvokerRepository(clientConfig, true); Assert.assertTrue(invokerRepository.getInvokers().size() == 1); Assert.assertTrue(invokerRepository.isDirectConn()); invokerRepository.destroy(); Assert.assertTrue(invokerRepository.getInvokers().size() == 0); }