@Test
public void getInstancesShouldBeAbleToHandleEndpointsMultipleAddresses() {

	Map<String, String> labels = new HashMap();
	labels.put("l1", "v1");
	Endpoints endPoint = new EndpointsBuilder().withNewMetadata().withName("endpoint").withNamespace("test")
			.withLabels(labels).endMetadata().addNewSubset().addNewAddress().withIp("ip1").withNewTargetRef()
			.withUid("40").endTargetRef().endAddress().addNewAddress().withIp("ip2").withNewTargetRef()
			.withUid("50").endTargetRef().endAddress().addNewPort("https", "https_tcp", 443, "TCP").endSubset()
			.build();
	List<Endpoints> endpointsList = new ArrayList<>();
	endpointsList.add(endPoint);
	EndpointsList endpoints = new EndpointsList();
	endpoints.setItems(endpointsList);
	mockServer.expect().get().withPath(
			"/api/v1/namespaces/test/endpoints?labelSelector=l1%3Dv1&fieldSelector=metadata.name%3Dendpoint")
			.andReturn(200, endpoints).once();
	mockServer.expect().get().withPath("/api/v1/namespaces/test/endpoints?fieldSelector=metadata.name%3Dendpoint")
			.andReturn(200, endpoints).once();
	Service service = new ServiceBuilder().withNewMetadata().withName("endpoint").withNamespace("test")
			.withLabels(labels).endMetadata().build();
	mockServer.expect().get().withPath("/api/v1/namespaces/test/services/endpoint").andReturn(200, service)
			.always();
	final KubernetesDiscoveryProperties properties = new KubernetesDiscoveryProperties();
	properties.setServiceLabels(labels);
	properties.getMetadata().setAddAnnotations(false);
	properties.getMetadata().setAddLabels(false);
	final DiscoveryClient discoveryClient = new KubernetesDiscoveryClient(mockClient, properties,
			KubernetesClient::services, new DefaultIsServicePortSecureResolver(properties));
	final List<ServiceInstance> instances = discoveryClient.getInstances("endpoint");
	assertThat(instances).hasSize(2).filteredOn(ServiceInstance::isSecure).extracting(ServiceInstance::getHost)
			.containsOnly("ip1", "ip2");
}