Thanks to visit codestin.com Credit goes to docs.groovy-lang.org
Stream
stream()
Returns a sequential Stream with the specified element(s) as its source.
assert [].spliterator().stream().toList().isEmpty() assert ['one', 'two'].spliterator().stream().toList() == ['one', 'two']