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

    FileSystem fsMock = mock(FileSystem.class);
    when(fsMock.exists(any(Path.class))).thenReturn(false);
    when(fsMock.mkdirs(any(Path.class))).thenReturn(false);
    FileSystemUtils.ensureDirectoriesExist(Arrays.asList(new Path("one"), new Path("two")), fsMock);
}