### Question:
DirectoryWalker { public static Builder builder() { return new Builder(); } private  DirectoryWalker(
            @NonNull FileAction action,
            @NonNull Path start,
            @NonNull Collection<Predicate<Path>> filters); static Builder builder(); DirectoryWalker walk();  }### Answer:
@Test public void testNullRoot() throws IOException { try { DirectoryWalker.builder() .root(null) .action((root, path) -> {}) .build(); fail("code should throw before this point"); } catch (IllegalArgumentException iae) { assertEquals("cannot pass in a null root directory", iae.getMessage()); } }
@Test public void testForgottenRoot() throws IOException { try { DirectoryWalker.builder() .action((root, path) -> {}) .build(); fail("code should throw before this point"); } catch (IllegalArgumentException iae) { assertEquals("root cannot be left unset", iae.getMessage()); } }
@Test public void testForgottenAction() throws IOException { try { DirectoryWalker.builder() .root(root) .build(); fail("code should throw before this point"); } catch (IllegalArgumentException iae) { assertEquals("action cannot be left unset", iae.getMessage()); } }
@Test public void testNullExtension() throws IOException { try { DirectoryWalker.builder() .root(root) .extensions(null, "java") .action((root, path) -> {}) .build(); fail("code should throw before this point"); } catch (IllegalArgumentException iae) { assertEquals("cannot pass in a null extension", iae.getMessage()); } }
@Test public void testEmptyExtension() throws IOException { try { DirectoryWalker.builder() .root(root) .extensions("", "java") .action((root, path) -> {}) .build(); fail("code should throw before this point"); } catch (IllegalArgumentException iae) { assertEquals("cannot pass in an empty extension", iae.getMessage()); } }