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 testCacheInstanceForRedoByBatchInstanceRedoData() {
        ConcurrentMap<String, InstanceRedoData> registeredInstances = getInstanceRedoDataMap();
        assertTrue(registeredInstances.isEmpty());
        Instance instance = new Instance();
        List<Instance> instanceList = new ArrayList<>();
        instanceList.add(instance);
        redoService.cacheInstanceForRedo(SERVICE, GROUP, instanceList);
        assertFalse(registeredInstances.isEmpty());
        BatchInstanceRedoData actual = (BatchInstanceRedoData) registeredInstances.entrySet().iterator().next()
                .getValue();
        assertEquals(SERVICE, actual.getServiceName());
        assertEquals(GROUP, actual.getGroupName());
        assertEquals(instanceList, actual.getInstances());
        assertFalse(actual.isRegistered());
        assertFalse(actual.isUnregistering());
    }