@Test
  public void testClear() {
    mCache =
        createDummyAdaptiveCountingMemoryCache(
            mParamsSupplier,
            mCacheTrimStrategy,
            mValueDescriptor,
            100,
            1,
            2,
            initialLFUCacheFractionPromil);
    CloseableReference<Integer> originalRef1 = newReference(110);
    CloseableReference<Integer> cachedRef1 = mCache.cache(KEYS[1], originalRef1);
    originalRef1.close();
    AbstractAdaptiveCountingMemoryCache.Entry<String, Integer> entry1 =
        mCache.mCachedEntries.get(KEYS[1]);
    CloseableReference<Integer> originalRef2 = newReference(120);
    CloseableReference<Integer> cachedRef2 = mCache.cache(KEYS[2], originalRef2);
    originalRef2.close();
    cachedRef2.close();

    mCache.clear();
    assertTotalSize(0, 0);
    assertExclusivelyOwnedSize(0, 0);
    assertOrphanWithCount(entry1, 1);
    assertNotCached(KEYS[2], 120);
    verify(mReleaser).release(120);

    cachedRef1.close();
    verify(mReleaser).release(110);
  }
test: pass illegal adaptive rate and illegal initial LFU cache fraction. expected result: fall
back and use the default adaptive rate and initial LFU fraction values.
imagepipeline-base/src/test/java/com/facebook/imagepipeline/cache/AbstractAdaptiveCountingMemoryCacheTest.java