void () { Stream<String> stream = Stream.of("x"); double random = Math.random(); if (random > 0.5) { stream.forEach(System.out::println); } if (random > 0.9) { <warning descr="Stream has already been linked or consumed">stream</warning>.forEach(System.out::println); } }