@Test
  public void testDirectoryIsNuked() throws Exception {
    Assert.assertEquals(0, mDirectory.listFiles().length);

    // create file before setting final test date
    Assert.assertTrue(new File(mDirectory, "something-arbitrary").createNewFile());

    long lastModified = mDirectory.lastModified() - 1000;
    // some previous date to the "now" used for file creation
    Assert.assertTrue(mDirectory.setLastModified(lastModified));
    // check it was changed
    Assert.assertEquals(lastModified, mDirectory.lastModified());

    getStorageSupplier(1).get();

    // mDirectory exists...
    Assert.assertTrue(mDirectory.exists());
    // but it was created now
    Assert.assertTrue(lastModified < mDirectory.lastModified());
  }
Tests that an existing directory is nuked when it's not current version (doens't have the
version directory used for the structure)

@throws Exception
imagepipeline-base/src/test/java/com/facebook/cache/disk/DefaultDiskStorageTest.java