Given a DoubleStream s, I can do s.min() or s.max() but not both, as any one of them will consume the stream.
DoubleStream s
s.min()
s.max()
Now suppose I ha
You can call DoubleStream's summaryStatistics method. It returns a DoubleSummaryStatistics object that contains a min and a max, plus a few other statistics: average, count, and sum.
DoubleSummaryStatistics
IntStream and LongStream have similar summaryStatistics methods.
IntStream
LongStream
summaryStatistics