Alguem sabe dizer porque o codigo escrito da forma abaixo compila mas apresenta exception na execucao:
Stream<Curso> streamDeCurso = cursos.stream();
streamDeCurso.filter(c -> c.getAlunos() > 100);
streamDeCurso.forEach(c -> System.out.println(c.getNome()));
Exception in thread "main" java.lang.IllegalStateException: stream has already been operated upon or closed
at java.base/java.util.stream.AbstractPipeline.sourceStageSpliterator(AbstractPipeline.java:279)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
at TestaCurso.main(TestaCurso.java:21)