Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Caused by: java.lang.IllegalStateException: stream has already been operated upon or closed

Supplier<Stream<String>> streamSupplier 
  = () -> Stream.of("A", "B", "C", "D");
Optional<String> result1 = streamSupplier.get().findAny();
System.out.println(result1.get());
Optional<String> result2 = streamSupplier.get().findFirst();
System.out.println(result2.get());
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #Caused #stream #operated #closed
ADD COMMENT
Topic
Name
3+4 =