or Empty
Returns this sequence if it's not null
and the empty sequence otherwise.
Since Kotlin
1.3
Samples
import samples.*
import kotlin.test.*
fun main() {
//sampleStart
val nullSequence: Sequence<Int>? = null
assertPrints(nullSequence.orEmpty().toList(), "[]")
val sequence: Sequence<Int>? = sequenceOf(1, 2, 3)
assertPrints(sequence.orEmpty().toList(), "[1, 2, 3]")
//sampleEnd
}