@Override
    public void destroy() {
        notifyListeners.clear();
        domainCache.clear();
        if (scheduledExecutorService != null) {
            scheduledExecutorService.shutdown();
        }
    }
@Test
    public void testDestroy() {
        domainRegistry.init();
        ConsumerConfig<Object> config1 = new ConsumerConfig<>();
        String direct1 = "2";
        config1.setDirectUrl(direct1);
        domainRegistry.subscribe(config1);

        assertTrue(domainRegistry.scheduledExecutorService.isStarted());
        assertTrue(domainRegistry.notifyListeners.containsKey(direct1));
        domainRegistry.destroy();
        assertFalse(domainRegistry.scheduledExecutorService.isStarted());
        assertEquals(0, domainRegistry.notifyListeners.size());
    }