@Test
  public void testGetExtraMap() {
    when(mProducerListener.requiresExtraMap(mProducerContext, PRODUCER_NAME)).thenReturn(true);
    final Map<String, String> trueValue =
        ImmutableMap.of(
            DiskCacheReadProducer.EXTRA_CACHED_VALUE_FOUND,
            "true",
            DiskCacheReadProducer.ENCODED_IMAGE_SIZE,
            "123");
    assertEquals(
        trueValue,
        DiskCacheReadProducer.getExtraMap(mProducerListener, mProducerContext, true, 123));
    final Map<String, String> falseValue =
        ImmutableMap.of(DiskCacheReadProducer.EXTRA_CACHED_VALUE_FOUND, "false");
    assertEquals(
        falseValue,
        DiskCacheReadProducer.getExtraMap(mProducerListener, mProducerContext, false, 0));
  }
Checks basic properties of disk cache producer operation, that is: - it delegates to the {@link
BufferedDiskCache#get(CacheKey key, AtomicBoolean isCancelled)} - it returns a 'copy' of the
cached value - if {@link BufferedDiskCache#get(CacheKey key, AtomicBoolean isCancelled)} 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.
imagepipeline/src/test/java/com/facebook/imagepipeline/producers/DiskCacheReadProducerTest.java