public void createDir(File dir) {
    Path dirPath = requireNonNull(dir, "dir can not be null").toPath();
    if (dirPath.toFile().exists()) {
      checkState(dirPath.toFile().isDirectory(), "%s is not a directory", dirPath);
    } else {
      try {
        createDirectories(dirPath);
      } catch (IOException e) {
        throw new IllegalStateException(format("Failed to create directory %s", dirPath), e);
      }
    }
  }
@Test
  public void createDir_creates_specified_directory() throws IOException {
    File dir = new File(temp.newFolder(), "someDir");

    assertThat(dir).doesNotExist();

    underTest.createDir(dir);

    assertThat(dir).exists();
  }