private void testInputProducerSuccessButResultNotCacheableDueToStatusFlags(
      final @Consumer.Status int statusFlags) {
    setupInputProducerStreamingSuccessWithStatusFlags(statusFlags, mFinalEncodedImageFormatUnknown);
    mEncodedMemoryCacheProducer.produceResults(mConsumer, mProducerContext);

    verify(mMemoryCache, never()).cache(any(CacheKey.class), any(CloseableReference.class));
    verify(mConsumer).onNewResult(mIntermediateEncodedImage, statusFlags);
    verify(mConsumer).onNewResult(mFinalEncodedImageFormatUnknown, Consumer.IS_LAST | statusFlags);
    Assert.assertTrue(EncodedImage.isValid(mFinalEncodedImageClone));
    verify(mProducerListener).onProducerStart(mProducerContext, PRODUCER_NAME);
    Map<String, String> extraMap =
        ImmutableMap.of(EncodedMemoryCacheProducer.EXTRA_CACHED_VALUE_FOUND, "false");
    verify(mProducerListener)
        .onProducerFinishWithSuccess(mProducerContext, PRODUCER_NAME, extraMap);
    verify(mProducerListener, never())
        .onUltimateProducerReached(eq(mProducerContext), anyString(), anyBoolean());
  }
Checks basic properties of encoded 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 disk cache. - responses from the next producer are passed back
down to the consumer.
imagepipeline/src/test/java/com/facebook/imagepipeline/producers/EncodedMemoryCacheProducerTest.java