public static List<ServiceInstance> build(
            URL registryUrl, Collection<org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance>> instances) {
        return instances.stream().map((i) -> build(registryUrl, i)).collect(Collectors.toList());
    }
@Test
    void testBuild() {
        ServiceInstance dubboServiceInstance =
                new DefaultServiceInstance("A", "127.0.0.1", 8888, ApplicationModel.defaultModel());
        Map<String, String> metadata = dubboServiceInstance.getMetadata();
        metadata.put(METADATA_STORAGE_TYPE_PROPERTY_NAME, "remote");
        metadata.put(EXPORTED_SERVICES_REVISION_PROPERTY_NAME, "111");
        metadata.put("site", "dubbo");

        // convert {org.apache.dubbo.registry.client.ServiceInstance} to
        // {org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance>}
        org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance> curatorServiceInstance =
                CuratorFrameworkUtils.build(dubboServiceInstance);
        Assertions.assertEquals(curatorServiceInstance.getId(), dubboServiceInstance.getAddress());
        Assertions.assertEquals(curatorServiceInstance.getName(), dubboServiceInstance.getServiceName());
        Assertions.assertEquals(curatorServiceInstance.getAddress(), dubboServiceInstance.getHost());
        Assertions.assertEquals(curatorServiceInstance.getPort(), dubboServiceInstance.getPort());

        ZookeeperInstance payload = curatorServiceInstance.getPayload();
        Assertions.assertNotNull(payload);
        Assertions.assertEquals(payload.getMetadata(), metadata);
        Assertions.assertEquals(payload.getName(), dubboServiceInstance.getServiceName());

        // convert {org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance>} to
        // {org.apache.dubbo.registry.client.ServiceInstance}
        ServiceInstance serviceInstance = CuratorFrameworkUtils.build(registryUrl, curatorServiceInstance);
        Assertions.assertEquals(serviceInstance, dubboServiceInstance);

        // convert {Collection<org.apache.curator.x.discovery.ServiceInstance<ZookeeperInstance>>} to
        // {List<org.apache.dubbo.registry.client.ServiceInstance>}
        List<ServiceInstance> serviceInstances =
                CuratorFrameworkUtils.build(registryUrl, Arrays.asList(curatorServiceInstance));
        Assertions.assertNotNull(serviceInstances);
        Assertions.assertEquals(serviceInstances.get(0), dubboServiceInstance);
    }