### Question:
EurekaMetadataParser { public RoutedServices parseRoutes(Map<String, String> eurekaMetadata) { RoutedServices routes = new RoutedServices(); parseToListRoute(eurekaMetadata) .forEach(routes::addRoutedService); return routes; }  List<ApiInfo> parseApiInfo(Map<String, String> eurekaMetadata); RoutedServices parseRoutes(Map<String, String> eurekaMetadata); List<RoutedService> parseToListRoute(Map<String, String> eurekaMetadata); static Map<String, String> generateMetadata(String serviceId, ApiInfo apiInfo);  }### Answer:
@Test public void testParseRoutes() { Map<String, String> metadata = new HashMap<>(); metadata.put(ROUTES + ".api-v1." + ROUTES_GATEWAY_URL, "api/v1"); metadata.put(ROUTES + ".api-v1." + ROUTES_SERVICE_URL, "/"); metadata.put("other.parameter", "value"); metadata.put(ROUTES + ".api-v2." + ROUTES_SERVICE_URL, "/test"); metadata.put("some.garbage.again", "null"); metadata.put(ROUTES + ".api-v2." + ROUTES_GATEWAY_URL, "api/v2"); metadata.put(ROUTES + ".api-v3." + ROUTES_GATEWAY_URL, "incomplete"); metadata.put(ROUTES + ".api-v4." + ROUTES_SERVICE_URL, "incomplete"); metadata.put(ROUTES + ".api-v5." + ROUTES_GATEWAY_URL, "/api/v5/"); metadata.put(ROUTES + ".api-v5." + ROUTES_SERVICE_URL, "test"); RoutedServices routes = eurekaMetadataParser.parseRoutes(metadata); RoutedServices expectedRoutes = new RoutedServices(); expectedRoutes.addRoutedService( new RoutedService("api-v1", "api/v1", "/")); expectedRoutes.addRoutedService( new RoutedService("api-v2", "api/v2", "/test")); expectedRoutes.addRoutedService( new RoutedService("api-v5", "api/v5", "/test")); assertEquals(expectedRoutes.toString(), routes.toString()); }