Added missing function orElseThrow(currentValue -> exception).
Hardened generic parameters.