<commit_before>package org.codingmatters.poom.caches.in.memory;

import org.codingmatters.poom.caches.in.memory.caches.CacheWithStore;
import org.codingmatters.poom.caches.in.memory.stores.MapCacheStore;
import org.codingmatters.poom.caches.invalidation.Invalidation;
import org.codingmatters.poom.services.tests.Eventually;
import org.junit.After;
import org.junit.Test;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import static org.hamcrest.Matchers.contains;

public class CacheManagerTest {

    private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
    private final CacheManager<String, String> manager = CacheManager.newHashMapBackedCache(
            key -> key, (key, value) -> Invalidation.valid(),
            5,
            this.scheduler, 1, TimeUnit.SECONDS
    );
<commit_msg>refactor<commit_after>package org.codingmatters.poom.caches.in.memory;

import org.codingmatters.poom.caches.Cache;
import org.codingmatters.poom.caches.in.memory.caches.CacheWithStore;
import org.codingmatters.poom.caches.in.memory.stores.MapCacheStore;
import org.codingmatters.poom.caches.invalidation.Invalidation;
import org.codingmatters.poom.services.tests.Eventually;
import org.junit.After;
import org.junit.Test;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import static org.hamcrest.Matchers.contains;

public class CacheManagerTest {

    private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
    private final CacheManager<String, String> manager = CacheManager.newHashMapBackedCache(
            key -> key, Cache.ValueInvalidator.alwaysValid(),
            5,
            this.scheduler, 1, TimeUnit.SECONDS
    );

{'fraction_non_alphanumeric': 0.09798129000492369, 'fraction_numerical': 0.0029542097488921715, 'mean_word_length': 4.941520467836257, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3322344', 'n_tokens_mistral': 627, 'n_tokens_neox': 611, 'n_words': 104}