### Question:
LokateServiceDiscoveryProvider implements ServiceDiscoveryProvider { @Override public List<EndpointDefinition> loadServices(final String serviceName) { final URI serviceLookupURI = URI.create(URI.create(serviceName).getSchemeSpecificPart()); final List<URI> uris = discoveryService.lookupService(serviceName).blockingGet(Duration.ofSeconds(30)); return uris.stream().map(serviceResultURI -> { final String serviceName1 = serviceLookupURI.getSchemeSpecificPart().replace("/", "") .replace(":", "_").replace("?", "_").replace("=", "_").replace("&", "_"); final String serviceId = serviceName1 + "-" + serviceResultURI.getHost() + "-" + serviceResultURI.getPort(); return new EndpointDefinition(HealthStatus.PASS, serviceId, serviceName1, serviceResultURI.getHost(), serviceResultURI.getPort(), -1L); }).collect(Collectors.toList()); } private  LokateServiceDiscoveryProvider(final DiscoveryService discoveryService); static ServiceDiscovery createLokateServiceDiscovery(final List<URI> configs); static ServiceDiscovery createLokateServiceDiscovery(final URI... configs); @Override List<EndpointDefinition> loadServices(final String serviceName);  }### Answer:
@Test public void loadServices() throws Exception { final ServiceDiscovery lokateServiceDiscovery = LokateServiceDiscoveryProvider.createLokateServiceDiscovery(); lokateServiceDiscovery.start(); final List<EndpointDefinition> endpointDefinitions = lokateServiceDiscovery.loadServicesNow("discovery:echo:http: assertEquals(1, endpointDefinitions.size()); assertEquals("foo.com", endpointDefinitions.get(0).getHost()); assertEquals(8080, endpointDefinitions.get(0).getPort()); }