Reported in https://github.com/google/guava/issues/3086#issuecomment-378523615

Needs a fix like https://github.com/google/guava/commit/8f22dbc8ea0c1abdf044846057f6df8201ee9961
throws Exception {
    Path fileA = newFile("file-a");
    Path dir1 = newDir("dir-1");
    newFile("dir-1/file-b");
    newFile("dir-1/dir-2");
    assertThat(Iterables.limit(MoreFiles.fileTraverser().breadthFirst(rootDir), 3))
        .containsExactly(rootDir, fileA, dir1);
  }
  public void testFileTraverser_multipleDirectoryLayers_traversalReturnsAll() throws Exception {
    Path fileA = newFile("file-a");
    Path dir1 = newDir("dir-1");
    Path fileB = newFile("dir-1/file-b");
    Path dir2 = newFile("dir-1/dir-2");
    assertThat(MoreFiles.fileTraverser().breadthFirst(rootDir))
        .containsExactly(rootDir, fileA, fileB, dir1, dir2);
  }
  @CanIgnoreReturnValue
  private Path newDir(String name) throws IOException {
    Path dir = rootDir.resolve(name);
    Files.createDirectory(dir);
    return dir;
  }
  @CanIgnoreReturnValue
  private Path newFile(String name) throws IOException {
    Path file = rootDir.resolve(name);
    MoreFiles.touch(file);
    return file;
  }
}