Then I'll give you a hint for Streams: an Optional is much like a Stream containing at most 1 element.
The set of operations is very similar, so you can do pretty much the same thing with them, only with a Stream you have more elements than with an Optional.
2
u/Mr_Redstoner Aug 27 '20
Then I'll give you a hint for Streams: an Optional is much like a Stream containing at most 1 element.
The set of operations is very similar, so you can do pretty much the same thing with them, only with a Stream you have more elements than with an Optional.