@VisibleForTesting
  CopyObjectResult atomicCopy(
      S3ResourceId sourcePath, S3ResourceId destinationPath, ObjectMetadata sourceObjectMetadata)
      throws AmazonClientException {
    CopyObjectRequest copyObjectRequest =
        new CopyObjectRequest(
            sourcePath.getBucket(),
            sourcePath.getKey(),
            destinationPath.getBucket(),
            destinationPath.getKey());
    copyObjectRequest.setNewObjectMetadata(sourceObjectMetadata);
    copyObjectRequest.setStorageClass(config.getS3StorageClass());
    copyObjectRequest.setSourceSSECustomerKey(config.getSSECustomerKey());
    copyObjectRequest.setDestinationSSECustomerKey(config.getSSECustomerKey());
    return amazonS3.get().copyObject(copyObjectRequest);
  }
@Test
  public void testAtomicCopy() {
    testAtomicCopy(s3Config("s3"));
    testAtomicCopy(s3Config("other"));
    testAtomicCopy(s3ConfigWithSSECustomerKey("s3"));
    testAtomicCopy(s3ConfigWithSSECustomerKey("other"));
  }