void (int x) { Stream<String> stream = Stream.of("x"); if (x == 0) { stream.forEach(System.out::println); } <warning descr="Stream might have already been linked or consumed">stream</warning>.forEach(System.out::println); }