maybeCoalesce

fun <I : IntervalLike<I>> maybeCoalesce(list: List<I>, shouldCoalesce: I.(I) -> Boolean?): List<I>

Coalesces a list if the provided shouldCoalesce function is not null.