@VisibleForTesting
  public static RemoteIterator<S3AFileStatus> toProvidedFileStatusIterator(
          S3AFileStatus[] fileStatuses) {
    return filteringRemoteIterator(
        remoteIteratorFromArray(fileStatuses),
        Listing.ACCEPT_ALL_BUT_S3N::accept);
  }
@Test
  public void testProvidedFileStatusIteratorEnd() throws Exception {
    S3AFileStatus s3aStatus = new S3AFileStatus(
        100, 0, new Path("s3a://blah/blah"),
        8192, null, null, null);

    S3AFileStatus[] statuses = {
        s3aStatus
    };
    RemoteIterator<S3AFileStatus> it = Listing.toProvidedFileStatusIterator(
        statuses);

    Assert.assertTrue("hasNext() should return true first time", it.hasNext());
    Assert.assertEquals("first element from iterator",
        s3aStatus, it.next());
    Assert.assertFalse("hasNext() should now be false", it.hasNext());
    intercept(NoSuchElementException.class, it::next);
  }