@Override
    public boolean unRegistry() {
        check("un registry from zookeeper");
        if (instance != null) {
            try {
                this.serviceDiscovery.unregisterService(instance);
                return true;
            } catch (Exception exception) {
                LOGGER.log(Level.WARNING, "Can not un registry from zookeeper center!", exception);
            }
        }
        return false;
    }
@Test
    public void unRegistry() throws Exception {
        zkDiscoveryClient.unRegistry();
        Mockito.verify(serviceDiscovery, Mockito.times(1)).unregisterService(Mockito.any());

        // The simulation throws an exception
        Mockito.doThrow(new IllegalStateException("wrong")).when(serviceDiscovery).unregisterService(Mockito.any());
        zkDiscoveryClient.unRegistry();
    }