@Test
  public void testMoveItemsFromLFUToMFU() {
    // Cache has 4 entries; 2 for LFU and 2 for MFU
    // key is considered as MFU, if its accessCount > 1
    mCache =
        createDummyAdaptiveCountingMemoryCache(
            mParamsSupplier,
            mCacheTrimStrategy,
            mValueDescriptor,
            100,
            1,
            2,
            initialLFUCacheFractionPromil);

    // insert item2 to MFU
    CloseableReference<Integer> originalRef1 = newReference(10);
    CloseableReference<Integer> valueRef1a = mCache.cache(KEYS[1], originalRef1);
    CloseableReference<Integer> valueRef1b = mCache.get(KEYS[1]);
    originalRef1.close();
    valueRef1a.close();
    valueRef1b.close();
    assertMFUExclusivelyOwned(KEYS[1], 10);

    // insert item2 to LFU
    CloseableReference<Integer> originalRef2 = newReference(20);
    CloseableReference<Integer> valueRef2 = mCache.cache(KEYS[2], originalRef2);
    originalRef2.close();
    valueRef2.close();
    assertMFUExclusivelyOwned(KEYS[1], 10);
    assertLFUExclusivelyOwned(KEYS[2], 20);

    // access item2 one more time, this should result in moving item2 from LFU to MFU cache.
    CloseableReference<Integer> valueRef2a = mCache.get(KEYS[2]);
    valueRef2a.close();
    assertMFUExclusivelyOwned(KEYS[1], 10);
    assertMFUExclusivelyOwned(KEYS[2], 20);
  }
insert 1 MFU item and 1 LFU item, access the LFU item twice (to become MFU) and make sure it is
moved to the MFU cache.
imagepipeline-base/src/test/java/com/facebook/imagepipeline/cache/AbstractAdaptiveCountingMemoryCacheTest.java