public void zipDir(File dir, File toFile) {
    try {
      zipDirOrThrowIOE(dir, toFile);
    } catch (IOException e) {
      throw new IllegalStateException("Can not zip directory " + dir + " to file " + toFile, e);
    }
  }
@Test
  public void zipDir_throws_ISE_if_directory_is_a_file() throws Exception {
    File file = temp.newFile();

    assertThatThrownBy(() -> underTest.zipDir(file, temp.newFile()))
      .isInstanceOf(IllegalStateException.class)
      .hasMessageContaining("Can not zip directory " + file)
      .hasRootCauseMessage("File " + file + " exists but is not a directory");
  }