void () { Stream<String> stream = Stream.of("x"); switch (new Random().nextInt(10)) { case 0: stream.forEach(System.out::println); case 1: <warning descr="Stream might have already been linked or consumed">stream</warning>.forEach(System.out::println); } }