docs: public static S3ObjectSummary getSingleObjectSummary(ServerSideEncryptingAmazonS3 s3Client, String bucket, String key)
    {
      final ListObjectsV2Request request = new ListObjectsV2Request()
          .withBucketName(bucket)
          .withPrefix(key)
          .withMaxKeys(1);
      final ListObjectsV2Result result = s3Client.listObjectsV2(request);
  
      // Using getObjectSummaries().size() instead of getKeyCount as, in some cases
      // it is observed that even though the getObjectSummaries returns some data
      // keyCount is still zero.
      if (result.getObjectSummaries().size() == 0) {
        throw new ISE("Cannot find object for bucket[%s] and key[%s]", bucket, key);
      }
      final S3ObjectSummary objectSummary = result.getObjectSummaries().get(0);
      if (!objectSummary.getBucketName().equals(bucket) || !objectSummary.getKey().equals(key)) {
        throw new ISE("Wrong object[%s] for bucket[%s] and key[%s]", objectSummary, bucket, key);
      }
  
      return objectSummary;
    }