private static CacheEvent duplicateEvent(CacheEvent cacheEvent) {
      SettableCacheEvent copyEvent = SettableCacheEvent.obtain();
      copyEvent.setCacheKey(cacheEvent.getCacheKey());
      copyEvent.setCacheLimit(cacheEvent.getCacheLimit());
      copyEvent.setCacheSize(cacheEvent.getCacheSize());
      copyEvent.setEvictionReason(cacheEvent.getEvictionReason());
      copyEvent.setException(cacheEvent.getException());
      copyEvent.setItemSize(cacheEvent.getItemSize());
      copyEvent.setResourceId(cacheEvent.getResourceId());
      return copyEvent;
    }
CacheEventListener implementation which copies the data from each event into a new instance to
work-around the recycling of the original event and forwards the copy so that assertions can be
made afterwards.
imagepipeline-base/src/test/java/com/facebook/cache/disk/DiskStorageCacheTest.java