For each element in the stream, call the given function
Check if the stream has a next element
Map the stream to another stream
Read the next element from the stream