Here is one way to get this functionality:
Stream<String> stream = Stream.of ("first");
String single = stream.reduce((a,b)->{throw new SomeException();})
.get();
, , reduce . , get() NoSuchElementException.
, , :
Stream<String> stream = Stream.of ("first");
String single = stream.reduce((a,b)->{throw new SomeException();})
.orElseThrow(SomeException::new);