void () { Stream<String> stream = Stream.of("x"); int x = new Random().nextInt(10); if (x < 2) { stream.forEach(System.out::println); } if (x < 1) { <warning descr="Stream has already been linked or consumed">stream</warning>.forEach(System.out::println); } }