// always keeps a dynamically updated list of the n most probable // results // not synchronized sclass SetOfMostProbable extends TreeSetWithDuplicates> { int maxSize = 10; *() {} *(int *maxSize) {} public bool add(WithProbability a) { if (a == null) false; super.add(a); truncateTreeSetWithDuplicates(this, maxSize); true; } void setMaxSize(int *maxSize) {} }