sclass LinkedTreeMap_simple {
Map map;
new L list;
*() { map = new TreeMap; }
*(Map *map) {}
public B get(Object key) {
ret map.get(key);
}
public B put(A key, B value) {
if (!map.containsKey(key))
list.add(key);
return map.put(key, value);
}
public bool containsKey(O key) {
ret map.containsKey(key);
}
public Iterator keyIterator() {
ret iterator(list);
}
public Iterator> entryIterator() {
ret mapI(keyIterator(), a -> new AbstractMap.SimpleImmutableEntry(a, map.get(a)));
}
}