What is the purpose of the reduce() method in a stream pipeline?
a) To transform a stream into a new stream
b) To terminate the stream and return a single result
c) To filter the stream elements
d) To perform a side-effect on the stream elements