original.java
private CacheBuilderFactory cacheFactory() {
return new CacheBuilderFactory()
.withKeyStrengths(ImmutableSet.of(Strength.STRONG, Strength.WEAK))
.withValueStrengths(ImmutableSet.copyOf(Strength.values()))
.withConcurrencyLevels(ImmutableSet.of(1, 4, 16, 64))
.withMaximumSizes(ImmutableSet.of(400, 1000))
.withInitialCapacities(ImmutableSet.of(0, 1, 10, 100, 1000))
.withExpirations(ImmutableSet.of(
ExpirationSpec.afterAccess(10, SECONDS),
ExpirationSpec.afterAccess(1, DAYS),
ExpirationSpec.afterWrite(10, SECONDS),
ExpirationSpec.afterWrite(1, DAYS)));
}
modified.java
private CacheBuilderFactory cacheFactory() {
return new CacheBuilderFactory()
.withKeyStrengths(ImmutableSet.of(Strength.STRONG, Strength.WEAK))
.withValueStrengths(ImmutableSet.copyOf(Strength.values()))
.withConcurrencyLevels(ImmutableSet.of(1, 4, 16, 64))
.withMaximumSizes(ImmutableSet.of(400, 1000))
.withInitialCapacities(ImmutableSet.of(0, 1, 10, 100, 1000))
.withExpireAfterWrites(ImmutableSet.of(
DurationSpec.of(1, SECONDS),
DurationSpec.of(1, DAYS)))
.withExpireAfterAccesses(ImmutableSet.of(
DurationSpec.of(1, SECONDS),
DurationSpec.of(1, DAYS)))
.withRefreshes(ImmutableSet.of(
DurationSpec.of(1, SECONDS),
DurationSpec.of(1, DAYS)));
}