b) get() is useful and less verbose for cases where other logic has proven that the get() will succeed.
boolean allPresent = a.isPresent() && b.isPresent() if (allPresent){ doSomething(a.get()) }
b) get() is useful and less verbose for cases where other logic has proven that the get() will succeed.
edit: just noticed this example is the same idea merb posted earlier.