@Test
void ensureDirectory() throws Exception {

    Path directory = tempDir.resolve("created");
    Path file = tempDir.resolve("file");
    Utility.ensureDirectory(directory); // Creates successfully
    Utility.ensureDirectory(directory); // Already exists
    file.toFile().createNewFile();
    assertThatThrownBy(() -> Utility.ensureDirectory(file)).isInstanceOf(IllegalStateException.class);
    assertThatThrownBy(() -> Utility.ensureDirectory(null)).isInstanceOf(IllegalArgumentException.class);
}