private void verifyListenerOnHit(CacheKey key, String resourceId) {
    ArgumentCaptor<CacheEvent> cacheEventCaptor = ArgumentCaptor.forClass(CacheEvent.class);
    mCacheEventListenerInOrder.verify(mCacheEventListener).onHit(cacheEventCaptor.capture());

    for (CacheEvent event : cacheEventCaptor.getAllValues()) {
      CacheEventAssert.assertThat(event).isNotNull().hasCacheKey(key).hasResourceId(resourceId);
    }
  }
Verify that multiple threads can write to the cache at the same time.
imagepipeline-base/src/test/java/com/facebook/cache/disk/DiskStorageCacheTest.java