### Question:
AwsResource { public String getResource() { return resource; } AwsResource(String arn); String getArn(); String getResource(); String getService(); String getRegion(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void getResource_GivenRedshiftArn_ShouldReturnClusterName() { Assert.assertEquals("my-cluster", new AwsResource(redshiftArn).getResource()); }
@Test public void getResource_GivenLambdaArn_ShouldReturnFunctionName() { Assert.assertEquals("ProcessKinesisRecords", new AwsResource(lambdaArn).getResource()); }
@Test public void getResource_GivenFirehoseArn_ShouldReturnDeliveryStreamName() { Assert.assertEquals("my-deliverystream", new AwsResource(firehoseArn).getResource()); }
@Test public void getResource_GivenStreamArn_ShouldReturnStreamName() { Assert.assertEquals("example-stream-name", new AwsResource(streamArn).getResource()); }
@Test public void getResource_GivenS3Arn_ShouldReturnBucketName() { Assert.assertEquals("my_corporate_bucket", new AwsResource(s3Arn).getResource()); }
@Test public void getResource_GivenElasticsearchArn_ShouldReturnClusterName() { Assert.assertEquals("streaming-logs", new AwsResource(elasticsearchArn).getResource()); }