Which statement is true about java.util.stream.Stream?
A. A stream cannot be consumed more than once.
B. The execution mode of streams can be changed during processing.
C. Streams are intended to modify the source data.
D. A parallel stream is always faster than an equivalent sequential stream.
The correct answer is A.
From javadoc on java.util.stream package, Stream operations and pipelines section :
After the terminal operation is performed, the stream pipeline is considered consumed, and can no longer be used.
Another point – which has nothing to do with the current Problem but is hugely important for our exam in general – is that
Intermediate operations return a new stream (ibid.)
For example, peek() consumes elements by performing the specified action and then returns a new stream that consists of the exact same elements.