def terminated(): seq = Sequence.range(0, 5) seq.for_each(lambda _: None) return seq
def descendingNumbers(): return Sequence.range(0, 5).sort_descending()
def range(): return Sequence.range(0, 10) def rangeClosed(): return Sequence.range_closed(0, 10)
def skipWhile(): return Sequence.range(0, 10).skip_while(lambda k: k < 6) def distinctNumbers(): return Sequence.of(0, 2, 2, 0, 5, 10, 2, 5).distinct()
def skip(): return Sequence.range(0, 6).skip(3) def takeWhile(): return Sequence.iterate(1, lambda k: k * 2).take_while(lambda k: k < 20)