btree.minKey(t) is documented* to return the smallest key at least as big as t. It seems that if there is no such element it returns the maximum key. *in the programming guide, v3.6.0 Simon.