### Question:
FileServiceImpl implements FileService, ServletContextAware { @Override public boolean bundleDirectoryExists(String filename) { ListObjectsRequest request = new ListObjectsRequest(_bucketName, filename, null, null, 1); ObjectListing listing = _s3.listObjects(request); return listing.getObjectSummaries().size() > 0; }  @Override void setS3User(String user); @Override void setS3Password(String password); @Override void setBucketName(String bucketName); @Override String getBucketName(); @Override void setGtfsPath(String gtfsPath); @Override String getGtfsPath(); @Override void setStifPath(String stifPath); @Override String getStifPath(); @Override void setTransformationPath(String transformationPath); @Override String getTransformationPath(); @Override String getConfigPath(); @Override void setConfigPath(String configPath); @Override void setBuildPath(String buildPath); @Override String getBuildPath(); @PostConstruct @Override void setup(); @Override void setServletContext(ServletContext servletContext); @Override /** * check to see if the given bundle directory exists in the configured bucket. * Do not include leading slashes in the filename(key). */ boolean bundleDirectoryExists(String filename); @Override /** * delete an object from s3 */ void deleteObject(String filename); @Override boolean createBundleDirectory(String filename); @Override /** * Return tabular data (filename, flag, modified date) about bundle directories. */ List<String[]> listBundleDirectories(int maxResults); @Override /** * Copies an s3 object from one location to another */ void copyS3Object(String fromObjectKey, String toObjectKey); @Override /** * Return tabular data (filename, flag, modified date) about bundle directories. */ List<String> listBundleBuilds(String directoryName, int maxResults); @Override /** * Return files' names at a specified location. */ List<String> listFiles(String directoryName, int maxResults); @Override /** * Return fileName of objects in an S3 file. */ List<String> listObjects(String directoryName, int maxResults); @Override /** * Retrieve the specified key from S3 and store in the given directory. */ String get(String key, String tmpDir); InputStream get(String key); @Override /** * push the contents of the directory to S3 at the given key location. */ String put(String key, String file); String put(String prefix, String key, String file); @Override /** * list the files in the given directory. */ List<String> list(String directory, int maxResults); @Override String createOutputFilesZip(String s3Path); @Override void validateFileName(String fileName); List<Map<String,String>> listObjectsTabular(String directory, int maxResults);  }### Answer:
@Test public void testBundleDirectoryExists() { assertFalse(fileService.bundleDirectoryExists("noSuchDirectory")); assertTrue(fileService.bundleDirectoryExists("2012April")); }