@Test
  public void testCancelSingleRequest() {
    mMultiplexProducer.produceResults(mConsumer1, mProducerContext1);
    mProducerContext1.cancel();
    assertTrue(mMultiplexedContext1.isCancelled());
    mForwardingConsumer1.onCancellation();
    verify(mConsumer1).onCancellation();
    assertTrue(mMultiplexProducer.mMultiplexers.isEmpty());
    verifyNoMoreInteractions(mConsumer1);
  }
An extra flag to check we maintain other flags than just whether this is the last result
imagepipeline/src/test/java/com/facebook/imagepipeline/producers/MultiplexProducerTest.java