### Question:
SimpleCopyListing extends CopyListing { @Override protected long getNumberOfPaths() { return totalPaths; } protected  SimpleCopyListing(Configuration configuration, Credentials credentials); @Override void doBuildListing(Path pathToListingFile, S3MapReduceCpOptions options); @VisibleForTesting void doBuildListing(SequenceFile.Writer fileListWriter, S3MapReduceCpOptions options); @VisibleForTesting void doBuildListing(SequenceFile.Writer fileListWriter, S3MapReduceCpOptions options, List<Path> globbedPaths); static final String CONF_LABEL_ROOT_PATH; }### Answer:
@Test(timeout = 10000) public void skipFlagFiles() throws Exception { FileSystem fs = FileSystem.get(config); Path source = new Path(temporaryRoot + "/in4"); URI target = URI.create("s3: createFile(fs, new Path(source, "1/_SUCCESS")); createFile(fs, new Path(source, "1/file")); createFile(fs, new Path(source, "2")); Path listingPath = new Path(temporaryRoot + "/list4"); listing.buildListing(listingPath, options(source, target)); assertThat(listing.getNumberOfPaths(), is(2L)); Set<String> expectedRelativePaths = Sets.newHashSet("/1/file", "/2"); try (SequenceFile.Reader reader = new SequenceFile.Reader(config, SequenceFile.Reader.file(listingPath))) { CopyListingFileStatus fileStatus = new CopyListingFileStatus(); Text relativePath = new Text(); int relativePathCount = expectedRelativePaths.size(); for (int i = 0; i < relativePathCount; i++) { assertThat(reader.next(relativePath, fileStatus), is(true)); assertThat("Expected path not found " + relativePath.toString(), expectedRelativePaths.remove(relativePath.toString()), is(true)); } } assertThat("Expected relativePaths to be empty but was: " + expectedRelativePaths, expectedRelativePaths.isEmpty(), is(true)); }