in algebird-core/src/main/scala/com/twitter/algebird/Interval.scala [289:306]
override def contains(t: T)(implicit ordering: Ordering[T]): Boolean =
ordering.lt(t, upper)
override def greatest(implicit p: Predecessible[T]): Option[T] = p.prev(upper)
// The smallest value that is not present
override def strictUpperBound(implicit s: Successible[T]): Option[T] = Some(upper)
override def intersect(that: Interval[T])(implicit ordering: Ordering[T]): Interval[T] = that match {
case Universe() => this
case Empty() => that
case lb @ InclusiveLower(_) =>
if (lb.intersects(this)) Intersection(lb, this) else Empty()
case lb @ ExclusiveLower(_) =>
if (lb.intersects(this)) Intersection(lb, this) else Empty()
case InclusiveUpper(thatub) =>
if (ordering.lteq(upper, thatub)) this else that
case ExclusiveUpper(thatub) =>
if (ordering.lteq(upper, thatub)) this else that
case Intersection(thatL, thatU) => thatL && (this && thatU)
}