public FileInputStream openInputStream(File file) {
    try {
      return openInputStreamOrThrowIOE(file);
    } catch (IOException e) {
      throw new IllegalStateException("Can not open file " + file, e);
    }
  }
@Test
  public void openInputStream_throws_ISE_if_file_is_a_directory() throws Exception {
    File dir = temp.newFolder();

    assertThatThrownBy(() -> underTest.openInputStream(dir))
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Can not open file " + dir)
      .hasRootCauseMessage("File " + dir + " exists but is a directory");
  }