### Question:
PreGradle21Scanner { public static PreGradle21Scanner create(File dir) { return new PreGradle21Scanner(dir); } private  PreGradle21Scanner(File dir); static PreGradle21Scanner create(File dir); void scan(Consumer<File> fileProcessor);  }### Answer:
@Test public void createWhenNullThenIllegalArgumentException() { assertThatCode(() -> PreGradle21Scanner.create(null)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("dir cannot be null"); }
@Test public void createWhenNotDirThenIllegalArgumentException() throws IOException { File file = this.temp.newFile(); assertThatCode(() -> PreGradle21Scanner.create(file)) .isInstanceOf(IllegalArgumentException.class) .hasMessage(file + " is not a directory"); }