Returns the value of the reference if it is not null, otherwise returns the given value.
the value of the reference if it is not null, otherwise the given value
the value to return if the reference is null