net.jqwik.engine.support.LruCache Maven / Gradle / Ivy
The newest version!
package net.jqwik.engine.support;
import java.util.*;
public class LruCache extends LinkedHashMap {
private final int maxSize;
public LruCache(int maxSize) {
super(maxSize + 1, 1, true);
this.maxSize = maxSize;
}
@Override
protected boolean removeEldestEntry(Map.Entry eldest) {
return size() > maxSize;
}
}