### Question:
S3Link { public void setAcl(CannedAccessControlList acl) { setAcl(acl, null); } S3Link(S3ClientCache s3cc, String bucketName, String key);   S3Link(S3ClientCache s3cc, Region region, String bucketName, String key); private  S3Link(S3ClientCache s3cc, ID id); String getKey(); String getBucketName(); Region getS3Region(); String toJson(); static S3Link fromJson(S3ClientCache s3cc, String json); AmazonS3Client getAmazonS3Client(); TransferManager getTransferManager(); PutObjectResult uploadFrom(final File source); PutObjectResult uploadFrom(final File source,
            RequestMetricCollector requestMetricCollector); PutObjectResult uploadFrom(final byte[] buffer); PutObjectResult uploadFrom(final byte[] buffer,
            RequestMetricCollector requestMetricCollector); void setAcl(CannedAccessControlList acl); void setAcl(CannedAccessControlList acl, RequestMetricCollector col); void setAcl(AccessControlList acl); void setAcl(AccessControlList acl,
            RequestMetricCollector requestMetricCollector); URL getUrl(); ObjectMetadata downloadTo(final File destination); ObjectMetadata downloadTo(final File destination,
            RequestMetricCollector requestMetricCollector); ObjectMetadata downloadTo(final OutputStream output); ObjectMetadata downloadTo(final OutputStream output,
            RequestMetricCollector requestMetricCollector);  }### Answer:
@Test public void testSetACL() { AccessControlList acl = new AccessControlList(); EasyMock.reset(mockS3); EasyMock.expect(mockS3.getRegion()).andReturn(Region.US_Standard); mockS3.setObjectAcl(anyObject(String.class), anyObject(String.class), anyObject(String.class), eq(acl), eq((RequestMetricCollector) null)); EasyMock.expectLastCall().once(); EasyMock.replay(mockS3); mapper.getS3ClientCache().useClient(mockS3); S3Link link = mapper.createS3Link(bucket, key); link.setAcl(acl); EasyMock.verify(mockS3); }
@Test public void testSetCannedACL() { EasyMock.reset(mockS3); EasyMock.expect(mockS3.getRegion()).andReturn(Region.US_Standard); CannedAccessControlList cannedACL = CannedAccessControlList.Private; mockS3.setObjectAcl(anyObject(String.class), anyObject(String.class), anyObject(String.class), eq(cannedACL), eq((RequestMetricCollector) null)); EasyMock.expectLastCall().once(); EasyMock.replay(mockS3); mapper.getS3ClientCache().useClient(mockS3); S3Link link = mapper.createS3Link(bucket, key); link.setAcl(cannedACL); EasyMock.verify(mockS3); }