code: public static Object valueOrException(Object rv, Throwable throwable) throws Throwable {
        if (throwable == null) {
           return rv;
        } else {
           throw throwable;
        }
     }
docs: Return the value if {@code throwable != null}, throw the exception otherwise.