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

    final DefaultDiskStorage storage = getStorageSupplier(1).get();
    final String resourceId = "file1";

    final byte[] CONTENT = "content".getBytes("UTF-8");

    // create a file so we know version directory really exists
    DiskStorage.Inserter inserter = storage.insert(resourceId, null);
    writeToResource(inserter, CONTENT);
    inserter.commit(null);

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

    // create again, it shouldn't delete the directory
    getStorageSupplier(1).get();

    // mDirectory exists...
    Assert.assertTrue(mDirectory.exists());
    // and it's the same as before
    Assert.assertEquals(lastModified, mDirectory.lastModified());
  }
Tests that an existing directory is not nuked if the version directory used for the structure
exists (so it's current version and doesn't suffer Samsung RFS problem)

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