### Question:
RegionMetadata { public List<Region> getRegionsForService(final String service) { List<Region> results = new LinkedList<Region>(); for (Region region : regions) { if (region.isServiceSupported(service)) { results.add(region); } } return results; } RegionMetadata(final List<Region> regions); List<Region> getRegions(); Region getRegion(final String name); List<Region> getRegionsForService(final String service); Region getRegionByEndpoint(final String endpoint); @Override String toString();  }### Answer:
@Test public void testGetRegionsForService() { List<Region> regions = metadata.getRegionsForService("s3"); Assert.assertNotNull(regions); Assert.assertEquals(2, regions.size()); Assert.assertEquals("us-east-1", regions.get(0).getName()); Assert.assertEquals("us-west-1", regions.get(1).getName()); regions = metadata.getRegionsForService("bogus-monkeys"); Assert.assertNotNull(regions); Assert.assertTrue(regions.isEmpty()); }