@Override
    public synchronized void unregister(P provider) {
        checkNotNull(provider, "Provider cannot be null");
        S service = services.get(provider.id());
        if (service instanceof AbstractProviderService) {
            ((AbstractProviderService) service).invalidate();
            services.remove(provider.id());
            providers.remove(provider.id());
            if (!provider.id().isAncillary()) {
                providersByScheme.remove(provider.id().scheme());
            }
        }
    }
@Test
    public void voidUnregistration() {
        TestProviderRegistry registry = new TestProviderRegistry();
        registry.unregister(new TestProvider(new ProviderId("of", "foo")));
    }