FED-285: Replace scala option getOrElse(null) calls from java with utili...

...ty that doesn't throw NullPointerException.