### Question:
S3ObjectInfo { public File createDownloadFile(String parent) { return new File(parent, fileName); } S3ObjectInfo(String s3Uri); String bucket(); String key(); File createDownloadFile(String parent); S3ObjectInfo withNewKeySuffix(String suffix); S3ObjectInfo replaceOrAppendKey(String placeholder, String ifPresent, String ifAbsent); S3ObjectInfo replaceOrAppendKey(String placeholder, String ifPresent); @Override String toString();  }### Answer:
@Test public void canCreateDownloadFileForKeyWithoutTrailingSlash(){ String s3Uri = "s3: S3ObjectInfo s3ObjectInfo = new S3ObjectInfo(s3Uri); assertEquals("/temp/c.txt", s3ObjectInfo.createDownloadFile("/temp").getAbsolutePath()); }
@Test public void canCreateDownloadFileForKeyWithTrailingSlash(){ String s3Uri = "s3: S3ObjectInfo s3ObjectInfo = new S3ObjectInfo(s3Uri); assertEquals("/temp/c", s3ObjectInfo.createDownloadFile("/temp").getAbsolutePath()); }