public void unregister(String name) {
        HealthCheck healthCheck;
        synchronized (lock) {
            healthCheck = healthChecks.remove(name);
            if (healthCheck instanceof AsyncHealthCheckDecorator) {
                ((AsyncHealthCheckDecorator) healthCheck).tearDown();
            }
        }
        if (healthCheck != null) {
            onHealthCheckRemoved(name, healthCheck);
        }
    }
@Test
    public void asyncHealthCheckIsCanceledOnRemove() {
        registry.unregister("ahc");

        verify(af).cancel(true);
    }