void () { Stream<String> stream = Stream.of("x"); int x = new Random().nextInt(10); if (x < 2) { Spliterator<String> spliterator = stream.spliterator(); } if (x > 5) { Iterator<String> iterator = stream.iterator(); } }