def METHOD_NAME(writes, data):
    scores = {}
    n_keys = len({k for k, _ in writes})
    assume(n_keys > 1)
    size = data.draw(st.integers(1, n_keys - 1))
    evicted = set()
    def new_score(key):
        scores[key] = data.draw(st.integers(0, 1000), label=f"scores[{key!r}]")
        return scores[key]
    last_entry = [None]
    class Cache(GenericCache):
        def new_entry(self, key, value):
            last_entry[0] = key
            evicted.discard(key)
            assert key not in scores
            return new_score(key)
        def on_access(self, key, value, score):
            assert key in scores
            return new_score(key)
        def on_evict(self, key, value, score):
            note(f"Evicted {key!r}")
            assert score == scores[key]
            del scores[key]
            if len(scores) > 1:
                assert score <= min(v for k, v in scores.items() if k != last_entry[0])
            evicted.add(key)
    target = Cache(max_size=size)
    model = {}
    for k, v in writes:
        target[k] = v
        model[k] = v
    assert evicted
    assert len(evicted) + len(target) == len(model)
    assert len(scores) == len(target)
    for k, v in model.items():
        try:
            assert target[k] == v
            assert k not in evicted
        except KeyError:
            assert k in evicted