intersect

fun <T : Comparable<T>> ClosedRange<T>.intersect(other: ClosedRange<T>): Pair<T, T>?
fun IntRange.intersect(other: IntRange): IntRange?
fun LongRange.intersect(other: LongRange): LongRange?