public void testUpdateBucketACL() throws InterruptedException, ExecutionException, TimeoutException, IOException,
Exception {
String bucketName = getContainerName();
try {
// Confirm the bucket is private
AccessControlList acl = getApi().getBucketACL(bucketName);
String ownerId = acl.getOwner().getId();
assertEquals(acl.getGrants().size(), 1);
assertTrue(acl.hasPermission(ownerId, Permission.FULL_CONTROL));
addGrantsToACL(acl);
assertEquals(acl.getGrants().size(), 4);
assertTrue(getApi().putBucketACL(bucketName, acl));
// Confirm that the updated ACL has stuck.
acl = getApi().getBucketACL(bucketName);
checkGrants(acl);