### Question:
RegionUtils { @SuppressWarnings("checkstyle:hiddenfield") public static synchronized List<Region> getRegionsForService(String serviceAbbreviation) { List<Region> regions = new LinkedList<Region>(); for (Region r : getRegions()) { if (r.isServiceSupported(serviceAbbreviation)) { regions.add(r); } } return regions; }  static synchronized List<Region> getRegions(); @SuppressWarnings("checkstyle:hiddenfield") static synchronized List<Region> getRegionsForService(String serviceAbbreviation); static Region getRegion(String regionName); static Region getRegionByEndpoint(String endpoint); static synchronized void init();  }### Answer:
@Test public void testGetRegionsForService() { List<Region> regions = RegionUtils.getRegionsForService(ServiceAbbreviations.SimpleDB); assertEquals(regions.size(), 9); boolean usEast1 = false; boolean usWest1 = false; for (Region curr : regions) { if (curr.getName().equalsIgnoreCase("us-east-1")) { usEast1 = true; assertEquals(curr.getServiceEndpoint(ServiceAbbreviations.SimpleDB), "sdb.amazonaws.com"); } if (curr.getName().equalsIgnoreCase("us-west-1")) usWest1 = true; } assertTrue(usEast1); assertTrue(usWest1); }
@Test public void testGetRegionsForService() { List<Region> regions = RegionUtils.getRegionsForService(ServiceAbbreviations.SimpleDB); assertEquals(regions.size(), 8); boolean usEast1 = false; boolean usWest1 = false; for (Region curr : regions) { if (curr.getName().equalsIgnoreCase("us-east-1")) { usEast1 = true; assertEquals(curr.getServiceEndpoint(ServiceAbbreviations.SimpleDB), "sdb.amazonaws.com"); } if (curr.getName().equalsIgnoreCase("us-west-1")) usWest1 = true; } assertTrue(usEast1); assertTrue(usWest1); }