Stream operations are divided into intermediate and terminal operations, and are combined to form stream pipelines. A stream should be operated on
(invoking an intermediate or terminal stream operation) only once.
Noncompliant code example
Stream<Widget> pipeline = widgets.stream().filter(b -> b.getColor() == Color.RED);
var res1 = pipeline.findAny();
var res2 = pipeline.mapToInt(b -> b.getWeight()).sum(); // Noncompliant