private void assertOrphanWithCount(
      AbstractAdaptiveCountingMemoryCache.Entry<String, Integer> entry, int count) {
    assertNotSame("entry found in the cahce", entry, mCache.mCachedEntries.get(entry.key));
    assertNotSame(
        "entry found in the LFU execlusive",
        entry,
        mCache.mLeastFrequentlyUsedExclusiveEntries.get(entry.key));
    assertNotSame(
        "entry found in the MFU execlusive",
        entry,
        mCache.mMostFrequentlyUsedExclusiveEntries.get(entry.key));
    assertTrue("entry is not an orphan", entry.isOrphan);
    assertEquals("client count mismatch", count, entry.clientCount);
  }
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