@Test
public void ensureExistingDirectoryExists() throws IOException {

    FileSystem fsMock = mock(FileSystem.class);
    Path path = new Path("existing");
    when(fsMock.exists(any(Path.class))).thenReturn(true);
    FileSystemUtils.ensureDirectoriesExist(Collections.singleton(path), fsMock);
    verify(fsMock, times(1)).exists(path);
    verify(fsMock, times(0)).mkdirs(any(Path.class));
}