public static void setInstanceIdIfEmpty(Instance instance, String groupedServiceName) {
        if (null != instance && StringUtils.isEmpty(instance.getInstanceId())) {
            if (StringUtils.isBlank(instance.getServiceName())) {
                instance.setServiceName(groupedServiceName);
            }
            instance.setInstanceId(InstanceIdGeneratorManager.generateInstanceId(instance));
        }
    }
@Test
    void testSetInstanceIdIfEmpty() {
        Instance instance = new Instance();
        instance.setIp("1.1.1.1");
        instance.setPort(8890);
        String groupedServiceName = "test";
        instance.setClusterName("testCluster");
        InstanceUtil.setInstanceIdIfEmpty(instance, groupedServiceName);
        assertNotNull(instance.getInstanceId());
        assertEquals(instance.getInstanceId(), InstanceIdGeneratorManager.generateInstanceId(instance));
        String customInsId = "customInstanceId_1";
        Instance instance1 = new Instance();
        instance1.setInstanceId(customInsId);
        InstanceUtil.setInstanceIdIfEmpty(instance1, groupedServiceName);
        assertEquals(instance1.getInstanceId(), customInsId);
    }