private AbstractAdaptiveCountingMemoryCache<String, Integer>
      createDummyAdaptiveCountingMemoryCache(
          Supplier<MemoryCacheParams> memoryCacheParamsSupplier,
          AbstractAdaptiveCountingMemoryCache.CacheTrimStrategy cacheTrimStrategy,
          ValueDescriptor<Integer> valueDescriptor,
          int adaptiveRatePromil,
          int frequentlyUsedThreshold,
          int ghostListMaxSize,
          int lfuFractionPromil) {
    return new AbstractAdaptiveCountingMemoryCache<String, Integer>(
        memoryCacheParamsSupplier,
        cacheTrimStrategy,
        valueDescriptor,
        adaptiveRatePromil,
        frequentlyUsedThreshold,
        ghostListMaxSize,
        lfuFractionPromil) {
      @Override
      protected void logIllegalLfuFraction() {}

      @Override
      protected void logIllegalAdaptiveRate() {}

      @Nullable
      @Override
      public String getDebugData() {
        return null;
      }
    };
  }
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