@Test(expected = IOException.class)
public void ensureSomeExistingDirectoriesDontExist() throws IOException {

    FileSystem fsMock = mock(FileSystem.class);
    Path existingPath = new Path("existing");
    Path nonExistingPath = new Path("non existing");
    when(fsMock.exists(eq(existingPath))).thenReturn(true);
    when(fsMock.exists(eq(nonExistingPath))).thenReturn(false);
    when(fsMock.mkdirs(eq(nonExistingPath))).thenReturn(false);
    FileSystemUtils.ensureDirectoriesExist(Arrays.asList(existingPath, nonExistingPath), fsMock);
}