I’d like to use
Java.util.Optional.orElseThrow()
with an exception type that requires a constructor parameter. Something like this:
orElseThrow(MyException::new(someArgument)) // obviously NOT working
Is there a way to create a supplier that exceeds the value of my argument?