// elements are put to front when added (not when accessed)
persistable sclass MRUCache extends LinkedHashMap {
int maxSize = 10;
*() {}
*(int *maxSize) {}
protected bool removeEldestEntry(Map.Entry eldest) {
ret size() > maxSize;
}
O _serialize() {
ret ll(maxSize, cloneLinkedHashMap(this));
}
static MRUCache _deserialize(L l) {
new MRUCache m;
m.maxSize = (int) first(l);
m.putAll((LinkedHashMap) second(l));
ret m;
}
}