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