I\'d like to use
java.util.Optional.orElseThrow()
with an Exception type that asks for a constructor parameter. Something like this:
Sure.
.orElseThrow(() -> new MyException(someArgument))