I recently stumbled over some (imho) confusing behavior of the methods minAfter and maxBefore in TreeSet. Let me explain what I mean with an example:
import scala.collection.immutable.TreeSet val t = TreeSet(0) println(t.minAfter(0)) // evaluates to Some(0) println(t.maxBefore(0)) // evaluates to None
Since the names are so similar I would have expected a more coherent behavior. So minAfter is equal to “ceilEntry” whereas maxBefore is equal to “lowerEntry”. I would suggest an extension of the current api to the methods: lowerEntry, floorEntry, higherEntry and ceilEntry. I think the new names would be more descriptive and not clash with the old names which could be set to deprecated.