PutBucketOptions extends BaseHttpRequestOptions { @Override public Multimap<String, String> buildRequestHeaders() { checkState(headerTag != null, "headerTag should have been injected!"); Multimap<String, String> returnVal = LinkedHashMultimap.create(); for (Entry<String, String> entry : headers.entries()) { returnVal.put(entry.getKey().replace("aws", headerTag), entry.getValue()); } return returnVal; }  @Inject void setHeaderTag(@Named(PROPERTY_HEADER_TAG) String headerTag); @Override Multimap<String, String> buildRequestHeaders(); PutBucketOptions withBucketAcl(CannedAccessPolicy acl); CannedAccessPolicy getAcl();  }
@Test void testBuildRequestHeaders() { PutBucketOptions options = withBucketAcl(CannedAccessPolicy.AUTHENTICATED_READ); options.setHeaderTag(S3Headers.DEFAULT_AMAZON_HEADERTAG); Multimap<String, String> headers = options.buildRequestHeaders(); assertEquals(headers.get(S3Headers.CANNED_ACL).iterator().next(), CannedAccessPolicy.AUTHENTICATED_READ.toString()); }