### Question:
ConsulRegistryServiceImpl implements RegistryService<ConsulListener> { @Override public void register(InetSocketAddress address) throws Exception { NetUtil.validAddress(address); getConsulClient().agentServiceRegister(createService(address)); } 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 testRegister() throws Exception { RegistryService registryService = mock(ConsulRegistryServiceImpl.class); InetSocketAddress inetSocketAddress = new InetSocketAddress("127.0.0.1", 8091); registryService.register(inetSocketAddress); verify(registryService).register(inetSocketAddress); }