public void instanceDeregister(String serviceName, String groupName) {
        String key = NamingUtils.getGroupedName(serviceName, groupName);
        synchronized (registeredInstances) {
            InstanceRedoData redoData = registeredInstances.get(key);
            if (null != redoData) {
                redoData.setUnregistering(true);
                redoData.setExpectedRegistered(false);
            }
        }
    }
@Test
    void testInstanceDeregister() {
        ConcurrentMap<String, InstanceRedoData> registeredInstances = getInstanceRedoDataMap();
        redoService.cacheInstanceForRedo(SERVICE, GROUP, new Instance());
        redoService.instanceDeregister(SERVICE, GROUP);
        InstanceRedoData actual = registeredInstances.entrySet().iterator().next().getValue();
        assertTrue(actual.isUnregistering());
        assertFalse(actual.isExpectedRegistered());
    }