@Test
  public void testIsEnabled() throws Exception {
    DiskStorage storageMock = mock(DiskStorage.class);
    when(storageMock.isEnabled()).thenReturn(true).thenReturn(false);

    DiskStorageCache cache = createDiskCache(storageMock, false);
    assertTrue(cache.isEnabled());
    assertFalse(cache.isEnabled());
  }
Verify that multiple threads can write to the cache at the same time.
imagepipeline-base/src/test/java/com/facebook/cache/disk/DiskStorageCacheTest.java