filterWithNext

inline fun <T> Iterable<T>.filterWithNext(crossinline predicate: (a: T, b: T) -> Boolean): List<T>

Returns a list containing only elements where the pair of it and its successor matches the given predicate. The last element is always included.