persistable sclass LinkedTreeSet extends AbstractSet {
Set set;
new LinkedList list;
*() { set = new TreeSet; }
*(Set *set) {}
public int size() { ret list.size(); }
public Iterator iterator() { ret list.iterator(); }
public bool contains(O o) { ret set.contains(o); }
public bool add(A a) {
if (!set.add(a)) false;
ret true with list.add(a);
}
// TODO: optimize
public bool remove(O o) {
if (!set.remove(o)) false;
ret true with list.remove(o);
}
}