void () { ArrayList<String> strings = new ArrayList<>(); strings.add("x"); Stream<String> stream = strings.stream(); long count = stream.count(); double random = Math.random(); Stream<String> stringStream = <warning descr="Stream has already been linked or consumed">stream</warning>.onClose(() -> { }); }