@Test
  public void testEntryImmutable() throws Exception {
    DefaultDiskStorage storage = getStorageSupplier(1).get();

    final String resourceId1 = "resource1";
    final byte[] value1 = new byte[100];
    value1[80] = 123;
    final File file1 = writeFileToStorage(storage, resourceId1, value1);

    assertEquals(100, file1.length());
    List<DiskStorage.Entry> entries = storage.getEntries();
    DiskStorage.Entry entry = entries.get(0);
    long timestamp = entry.getTimestamp();
    when(mClock.now()).thenReturn(TimeUnit.HOURS.toMillis(1));
    storage.getResource(resourceId1, null);

    // now the new timestamp show be higher, but the entry should have the same value
    List<DiskStorage.Entry> newEntries = storage.getEntries();
    DiskStorage.Entry newEntry = newEntries.get(0);
    assertTrue(timestamp < newEntry.getTimestamp());
    assertEquals(timestamp, entry.getTimestamp());
  }
Inserts 3 files with different dates. Check what files are there. Uses an iterator to remove
the one in the middle. Check that later.

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