@Test
    public void testS3SpecialRegions() {
        assertEquals("us-east-1", AwsHostNameUtils.parseRegionName("s3-external-1.amazonaws.com", null));
        assertEquals("us-east-1", AwsHostNameUtils.parseRegionName("bucket.name.with.periods.s3-external-1.amazonaws.com", null));

        assertEquals("us-gov-west-1", AwsHostNameUtils.parseRegionName("s3-fips-us-gov-west-1.amazonaws.com", null));
        assertEquals("us-gov-west-1", AwsHostNameUtils.parseRegionName("bucket.name.with.periods.s3-fips-us-gov-west-1.amazonaws.com", null));
    }
Unit tests for the utility methods that parse information from AWS URLs.
aws-java-sdk-core/src/test/java/com/amazonaws/util/AwsHostNameUtilsTest.java