@Override
    public String generateInstanceId(Instance instance) {
        ensureWorkerIdInitialization();
        return SNOW_FLOWER_ID_GENERATOR.nextId() + NAMING_INSTANCE_ID_SPLITTER
                + instance.getClusterName() + NAMING_INSTANCE_ID_SPLITTER
                + instance.getServiceName();
    }
@Test
    void testGenerateInstanceId() {
        final SnowFlakeInstanceIdGenerator instanceIdGenerator = new SnowFlakeInstanceIdGenerator();
        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 = instanceIdGenerator.generateInstanceId(instance);
        assertTrue(instanceId.endsWith("#cluster#service"));
    }