### Question:
RegionMetadata { public Region getRegion(final String name) { return provider.getRegion(name); } RegionMetadata(final List<Region> regions);  RegionMetadata(RegionMetadataProvider provider); List<Region> getRegions(); Region getRegion(final String name); List<Region> getRegionsForService(final String service); @Deprecated Region getRegionByEndpoint(final String endpoint); @Override String toString();  }### Answer:
@Test public void testGetRegion() { Region region = metadata.getRegion("us-east-1"); Assert.assertNotNull(region); Assert.assertEquals("us-east-1", region.getName()); region = metadata.getRegion("us-west-1"); Assert.assertNotNull(region); Assert.assertEquals("us-west-1", region.getName()); region = metadata.getRegion("cn-north-1"); Assert.assertNotNull(region); Assert.assertEquals("cn-north-1", region.getName()); region = metadata.getRegion("bogus-monkeys"); Assert.assertNull(region); }
@Test public void testGetRegion() { Region region = metadata.getRegion("cn-beijing-6"); Assert.assertNotNull(region); Assert.assertEquals("cn-beijing-6", region.getName()); region = metadata.getRegion("cn-shanghai-2"); Assert.assertNotNull(region); Assert.assertEquals("cn-shanghai-2", region.getName()); region = metadata.getRegion("cn-beijing-1"); Assert.assertNotNull(region); Assert.assertEquals("cn-beijing-1", region.getName()); region = metadata.getRegion("bogus-monkeys"); Assert.assertNull(region); }