public static ServiceInstances transferServersToServiceInstances(Flux<List<ServiceInstance>> servers, InstanceTransformer instanceTransformer) {
		List<Instance> instanceList = Collections.synchronizedList(new ArrayList<>());
		servers.flatMap((Function<List<ServiceInstance>, Publisher<?>>) serviceInstances ->
				Flux.fromIterable(serviceInstances.stream()
						.map(instanceTransformer::transform)
						.collect(Collectors.toList()))).subscribe(instance -> instanceList.add((Instance) instance));

		String serviceName = "";
		Map<String, String> serviceMetadata = new HashMap<>();
		if (!CollectionUtils.isEmpty(instanceList)) {
			serviceName = instanceList.get(0).getService();
			serviceMetadata = instanceList.get(0).getServiceMetadata();
		}

		ServiceKey serviceKey = new ServiceKey(MetadataContext.LOCAL_NAMESPACE, serviceName);

		return new DefaultServiceInstances(serviceKey, instanceList, serviceMetadata);
	}
@Test
	public void testTransferNotEmptyInstances() {
		try (
				MockedStatic<ApplicationContextAwareUtils> mockedApplicationContextAwareUtils = mockStatic(ApplicationContextAwareUtils.class);
				MockedStatic<MetadataContextHolder> mockedMetadataContextHolder = mockStatic(MetadataContextHolder.class)
		) {
			mockedApplicationContextAwareUtils.when(() -> ApplicationContextAwareUtils.getProperties(anyString()))
					.thenReturn(testNamespaceAndService);
			MetadataContext metadataContext = Mockito.mock(MetadataContext.class);
			mockedMetadataContextHolder.when(MetadataContextHolder::get).thenReturn(metadataContext);

			int instanceSize = 100;
			int weight = 50;

			List<ServiceInstance> instances = new ArrayList<>();
			for (int i = 0; i < instanceSize; i++) {
				DefaultInstance instance = new DefaultInstance();
				instance.setService(testNamespaceAndService);
				instance.setId("ins" + i);
				instance.setPort(8080);
				instance.setHost("127.0.0." + i);
				instance.setWeight(weight);
				instances.add(new PolarisServiceInstance(instance));
			}

			ServiceInstances serviceInstances = RouterUtils.transferServersToServiceInstances(Flux.just(instances), new PolarisInstanceTransformer());

			assertThat(serviceInstances.getInstances()).isNotNull();
			assertThat(serviceInstances.getInstances().size()).isEqualTo(instanceSize);

			List<Instance> polarisInstances = serviceInstances.getInstances();
			for (int i = 0; i < instanceSize; i++) {
				Instance instance = polarisInstances.get(i);
				assertThat(instance.getNamespace()).isEqualTo(testNamespaceAndService);
				assertThat(instance.getService()).isEqualTo(testNamespaceAndService);
				assertThat(instance.getId()).isEqualTo("ins" + i);
				assertThat(instance.getHost()).isEqualTo("127.0.0." + i);
				assertThat(instance.getPort()).isEqualTo(8080);
				assertThat(instance.getWeight()).isEqualTo(weight);
			}
		}
	}