@Before
  public void setUp() {
    MockitoAnnotations.initMocks(this);
    mMemoryCacheProducer =
        new PostprocessedBitmapMemoryCacheProducer(mMemoryCache, mCacheKeyFactory, mInputProducer);
    mPostProcessorCacheKey = new SimpleCacheKey("blur");
    mPostprocessedBitmapCacheKey = new SimpleCacheKey("http://dummy.uri:blur");
    mImageRef2 = CloseableReference.of(mImage1);
    mImageRef1 = CloseableReference.of(mImage2);
    mImageRef2Clone = mImageRef2.clone();
    mImageRef1Clone = mImageRef1.clone();

    when(mProducerContext.getImageRequest()).thenReturn(mImageRequest);
    when(mProducerContext.getProducerListener()).thenReturn(mProducerListener);
    when(mProducerListener.requiresExtraMap(mProducerContext, PRODUCER_NAME)).thenReturn(true);
    when(mProducerContext.getId()).thenReturn(mRequestId);
    when(mProducerContext.getCallerContext()).thenReturn(PRODUCER_NAME);
    when(mImageRequest.getPostprocessor()).thenReturn(mPostprocessor);
    when(mPostprocessor.getPostprocessorCacheKey()).thenReturn(mPostProcessorCacheKey);
    when(mRepeatedPostprocessor.getPostprocessorCacheKey()).thenReturn(mPostProcessorCacheKey);
    when(mCacheKeyFactory.getPostprocessedBitmapCacheKey(mImageRequest, PRODUCER_NAME))
        .thenReturn(mPostprocessedBitmapCacheKey);

    setUpCacheEnabled(true);
  }
Checks basic properties of post-processed bitmap memory cache producer operation, that is: - it
delegates to the {@link MemoryCache#get(Object)} - if {@link MemoryCache#get(Object)} is
unsuccessful, then it passes the request to the next producer in the sequence. - if the next
producer returns the value, then it is put into the bitmap cache. - responses from the next
producer are passed back down to the consumer.
imagepipeline/src/test/java/com/facebook/imagepipeline/producers/PostprocessedBitmapMemoryCacheProducerTest.java