sclass WeightedSet extends WrappedMap { bool contains(A a) { ret containsKey(a); } double getWeight(A a) { ret or0(get(a)); } }