public void cacheInstanceForRedo(String serviceName, String groupName, Instance instance) {
        String key = NamingUtils.getGroupedName(serviceName, groupName);
        InstanceRedoData redoData = InstanceRedoData.build(serviceName, groupName, instance);
        synchronized (registeredInstances) {
            registeredInstances.put(key, redoData);
        }
    }
@Test
    void testCacheInstanceForRedo() {
        ConcurrentMap<String, InstanceRedoData> registeredInstances = getInstanceRedoDataMap();
        assertTrue(registeredInstances.isEmpty());
        Instance instance = new Instance();
        redoService.cacheInstanceForRedo(SERVICE, GROUP, instance);
        assertFalse(registeredInstances.isEmpty());
        InstanceRedoData actual = registeredInstances.entrySet().iterator().next().getValue();
        assertEquals(SERVICE, actual.getServiceName());
        assertEquals(GROUP, actual.getGroupName());
        assertEquals(instance, actual.get());
        assertFalse(actual.isRegistered());
        assertFalse(actual.isUnregistering());
        assertTrue(actual.isExpectedRegistered());
    }