private void assertMFUExclusivelyOwned(String key, Integer value) {
    assertTrue("key not found in the cache", mCache.mCachedEntries.contains(key));
    assertTrue(
        "key not found in the exclusives",
        mCache.mMostFrequentlyUsedExclusiveEntries.contains(key));
    AbstractAdaptiveCountingMemoryCache.Entry<String, Integer> entry =
        mCache.mCachedEntries.get(key);
    assertNotNull("entry not found in the cache", entry);
    assertEquals("key mismatch", key, entry.key);
    assertEquals("value mismatch", value, entry.valueRef.get());
    assertEquals("client count greater than zero", 0, entry.clientCount);
    assertFalse("entry is an orphan", entry.isOrphan);
  }
This test checks edge cases, when trying to increase/decrease the LFU cache fraction to more
than 1/less than 0 (of the cache size). The expected behaviour is not to update the LFU
fraction.
imagepipeline-base/src/test/java/com/facebook/imagepipeline/cache/AbstractAdaptiveCountingMemoryCacheTest.java