Java Optional if object is not null - returns the method result, if null - returns default value : <p>Is it possible to transform this code to java 8 Optional one-line expression?</p>

<pre><code>long lastPollTime;
if (object != null) {
    lastPollTime = object.getTime();
} else {
    lastPollTime = 0;
}
</code></pre>

<p>i.e. if some object is not null, I need to call object method and return its result, or else return 0.
Optional.ofNullable().orElse() is not suitable, as it returns the object of the same type, but i need the result of method call or some default value. </p>
