@Test
  public void testCancellation() {
    mSettableProducerContext.addCallbacks(mCallbacks1);
    verify(mCallbacks1, never()).onCancellationRequested();
    mSettableProducerContext.cancel();
    verify(mCallbacks1).onCancellationRequested();
    verify(mCallbacks1, never()).onIsPrefetchChanged();

    mSettableProducerContext.addCallbacks(mCallbacks2);
    verify(mCallbacks2).onCancellationRequested();
    verify(mCallbacks2, never()).onIsPrefetchChanged();
  }
Checks basic properties of NullProducer, that is that it always returns null.
imagepipeline/src/test/java/com/facebook/imagepipeline/producers/SettableProducerContextTest.java