### Question:
ConsulRegistryServiceImpl implements RegistryService<ConsulListener> { @Override public List<InetSocketAddress> lookup(String key) throws Exception { final String cluster = getServiceGroup(key); if (cluster == null) { return null; } if (!listenerMap.containsKey(cluster)) { refreshCluster(cluster); subscribe(cluster, services -> refreshCluster(cluster, services)); } return clusterAddressMap.get(cluster); } private  ConsulRegistryServiceImpl(); @Override void register(InetSocketAddress address); @Override void unregister(InetSocketAddress address); @Override void subscribe(String cluster, ConsulListener listener); @Override void unsubscribe(String cluster, ConsulListener listener); @Override List<InetSocketAddress> lookup(String key); @Override void close();  }### Answer:
@Test public void testLookup() throws Exception { RegistryService registryService = mock(ConsulRegistryServiceImpl.class); registryService.lookup("test-key"); verify(registryService).lookup("test-key"); }