net.jqwik.engine.support.LruCache Maven / Gradle / Ivy
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;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy