### Question:
S3Iterator implements Iterator<Path> { @Override public void remove() { throw new UnsupportedOperationException(); } S3Iterator(S3Path path);  S3Iterator(S3Path path, boolean incremental);  S3Iterator(S3FileStore fileStore, String key, boolean incremental); @Override boolean hasNext(); @Override S3Path next(); @Override void remove();  }### Answer:
@Test(expected = UnsupportedOperationException.class) public void remove() throws IOException { AmazonS3ClientMock client = AmazonS3MockFactory.getAmazonClientMock(); client.bucket("bucketA").dir("dir").file("dir/file1"); S3FileSystem s3FileSystem = (S3FileSystem) FileSystems.getFileSystem(endpoint); S3Path path = s3FileSystem.getPath("/bucketA", "dir"); S3Iterator iterator = new S3Iterator(path); iterator.remove(); }