### Question:
FileUtils { static String readTextFrom(File file) { assertValidFile(file); try { return new String(Files.readAllBytes(file.toPath())); } catch (IOException e) { throw new IllegalArgumentException("Could not read " + file, e); } } private  FileUtils();   }### Answer:
@Test public void readTextFromWhenNullThenIllegalArgumentException() { assertThatCode(() -> FileUtils.readTextFrom(null)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("file cannot be null"); }
@Test public void readTextFromWhenDirThenIllegalArgumentException() { assertThatCode(() -> FileUtils.readTextFrom(this.temp.newFolder())) .isInstanceOf(IllegalArgumentException.class) .hasCauseInstanceOf(IOException.class); }