Java 8 Optional get() method : <p>Is using get() method in this fashion the recommended approach when using Optional? </p>

<pre><code>Optional&lt;User&gt; loginUser = userService.findUserByEmail(authentication.getName());

if (loginUser.isPresent()) {
  User user = loginUser.get();
  user.setLastLogin(new Date());
  userService.saveUser(user);   
}
</code></pre>
