### Question:
S3Client { boolean doesObjectExist(String bucket, String key) { return amazonS3.doesObjectExist(bucket, key); } S3Client(AmazonS3 amazonS3, boolean dryRunEnabled);   }### Answer:
@Test void doesObjectExistForFile() { amazonS3.putObject(bucket, key2, content); boolean result = s3Client.doesObjectExist(bucket, key2); assertThat(result).isTrue(); }
@Test void doesObjectExistForFileWithSpaceInKey() { String spacedKey = key2 + "/ /file"; amazonS3.putObject(bucket, spacedKey, content); boolean result = s3Client.doesObjectExist(bucket, spacedKey); assertThat(result).isTrue(); }
@Test void doesObjectExistForDirectory() { amazonS3.putObject(bucket, key2, content); boolean result = s3Client.doesObjectExist(bucket, keyRoot); assertThat(result).isFalse(); }
@Test void doesObjectExistForDirectoryWithTrailingSlash() { amazonS3.putObject(bucket, key2, content); boolean result = s3Client.doesObjectExist(bucket, keyRoot + "/"); assertThat(result).isFalse(); }
@Test void doesObjectExist() { amazonS3.putObject(bucket, key1, content); boolean result = s3Client.doesObjectExist(bucket, key1); assertThat(result).isTrue(); }
@Test void doesObjectExistWithSpacedKey() { String spacedKey = key1 + "/ /file"; amazonS3.putObject(bucket, spacedKey, content); boolean result = s3Client.doesObjectExist(bucket, spacedKey); assertThat(result).isTrue(); }