### Question:
ServiceDefinitionsLoader { public static Set<ServiceDeploymentContributor> loadServiceDefinitionDeploymentContributors(File servicesDir) { final Set<ServiceDeploymentContributor> contributors = new HashSet<>(); loadServiceDefinitions(servicesDir).forEach( serviceDefinitionPair -> contributors.add(new ServiceDefinitionDeploymentContributor(serviceDefinitionPair.getService(), serviceDefinitionPair.getRewriteRules()))); return contributors; }  static Set<ServiceDeploymentContributor> loadServiceDefinitionDeploymentContributors(File servicesDir); static Set<ServiceDefinitionPair> loadServiceDefinitions(File servicesDir); static Set<ServiceDefinition> getServiceDefinitions(File servicesDir); static UrlRewriteRulesDescriptor loadRewriteRules(File servicesDir);  }### Answer:
@Test public void testServiceDefinitionLoading() { final List<String> barVersions = Arrays.asList("1.0.0", "2.0.0"); URL url = ClassLoader.getSystemResource("services"); Set<ServiceDeploymentContributor> contributors = ServiceDefinitionsLoader.loadServiceDefinitionDeploymentContributors(new File(url.getFile())); Assert.assertNotNull(contributors); Assert.assertEquals(2, contributors.size()); for (ServiceDeploymentContributor contributor : contributors) { if (contributor.getName().equals("foo")) { Assert.assertEquals("1.0.0", contributor.getVersion().toString()); Assert.assertEquals("FOO", contributor.getRole()); } else if (contributor.getName().equals("bar")) { Assert.assertTrue(barVersions.contains(contributor.getVersion().toString())); Assert.assertEquals("BAR", contributor.getRole()); } else { Assert.fail("the loaded services don't match the test input"); } } }