public ImmutableList<Path> walk(PathConsumer pathConsumer) throws IOException {
    ImmutableList<Path> files = walk();
    for (Path path : files) {
      pathConsumer.accept(path);
    }
    return files;
  }
@Test
  public void testWalk() throws IOException {
    new DirectoryWalker(testDir).walk(addToWalkedPaths);

    Set<Path> expectedPaths =
        new HashSet<>(
            Arrays.asList(
                testDir,
                testDir.resolve("a"),
                testDir.resolve("a").resolve("b"),
                testDir.resolve("a").resolve("b").resolve("bar"),
                testDir.resolve("c"),
                testDir.resolve("c").resolve("cat"),
                testDir.resolve("foo")));
    Assert.assertEquals(expectedPaths, walkedPaths);
  }