public static String generateInstanceId(Instance instance) {
        String instanceIdGeneratorType = instance.getInstanceIdGenerator();
        if (StringUtils.isBlank(instanceIdGeneratorType)) {
            instanceIdGeneratorType = Constants.DEFAULT_INSTANCE_ID_GENERATOR;
        }
        return INSTANCE.getInstanceIdGenerator(instanceIdGeneratorType).generateInstanceId(instance);
    }
@Test
    void testGenerateSnowFlakeInstanceId() {
        Instance instance = new Instance();
        Map<String, String> metaData = new HashMap<>(1);
        metaData.put(PreservedMetadataKeys.INSTANCE_ID_GENERATOR, SNOWFLAKE_INSTANCE_ID_GENERATOR);
        instance.setMetadata(metaData);
        instance.setServiceName("service");
        instance.setClusterName("cluster");
        instance.setIp("1.1.1.1");
        instance.setPort(1000);
        String instanceId = InstanceIdGeneratorManager.generateInstanceId(instance);
        assertTrue(instanceId.endsWith("#cluster#service"));
    }