void (String[] args) { long sum1 = LongStream.iterate(0, i -> i + 1).<warning descr="Non-short-circuit operation consumes infinite stream">sorted</warning>().limit(10).sum(); long sum2 = LongStream.generate(() -> 10).<warning descr="Non-short-circuit operation consumes infinite stream">sorted</warning>().limit(10).sum(); }