@Test
  public void testDoNotCachePartialResults() {
    setupBitmapMemoryCacheGetNotFound();
    setupInputProducerStreamingSuccessWithStatusFlags(Consumer.IS_PARTIAL_RESULT);
    when(mMemoryCache.get(mBitmapMemoryCacheKey)).thenReturn(null);

    mBitmapMemoryCacheProducer.produceResults(mConsumer, mProducerContext);

    verify(mConsumer).onNewResult(mIntermediateImageReference, Consumer.IS_PARTIAL_RESULT);
    verify(mConsumer)
        .onNewResult(mFinalImageReference, Consumer.IS_LAST | Consumer.IS_PARTIAL_RESULT);
    verify(mMemoryCache, never())
        .cache(any(BitmapMemoryCacheKey.class), any(CloseableReference.class));
  }
Verify that stateful image results, both intermediate and final, are never cached.
imagepipeline/src/test/java/com/facebook/imagepipeline/producers/BitmapMemoryCacheProducerTest.java