public void removeInstanceForRedo(String serviceName, String groupName) {
        String key = NamingUtils.getGroupedName(serviceName, groupName);
        synchronized (registeredInstances) {
            InstanceRedoData redoData = registeredInstances.get(key);
            if (null != redoData && !redoData.isExpectedRegistered()) {
                registeredInstances.remove(key);
            }
        }
    }
@Test
    void testRemoveInstanceForRedo() {
        ConcurrentMap<String, InstanceRedoData> registeredInstances = getInstanceRedoDataMap();
        assertTrue(registeredInstances.isEmpty());
        redoService.cacheInstanceForRedo(SERVICE, GROUP, new Instance());
        assertFalse(registeredInstances.isEmpty());
        redoService.instanceDeregister(SERVICE, GROUP);
        redoService.removeInstanceForRedo(SERVICE, GROUP);
        assertTrue(registeredInstances.isEmpty());
    }