 <p>IMHO there are three reasonable scenarios for <code>Optional</code>:</p> <ul> <li>Do something if there is a value</li> <li>Provide a default value otherwise</li> <li>The absence of a value is an error condition, in which case you want to fail fast</li> </ul> <p>Your scenario falls into the last category so I would simply write:</p> <pre><code> MyDao oq = myOptional.orElseThrow(() -&gt; new RuntimeException("Entity was not found"); if(!oq.getReferenceId().equals(objToUpdate.getId())) throw new RuntimeException("Bad Move!"); oq.setAttribute(objToUpdate.getAttribute()); </code></pre> <p>Of course, it's appealing to use methods like <code>ifPresent</code>, <code>filter</code> or <code>map</code>, but in your case, why would you want to continue when the application is in a faulty state. Now if you wouldn't throw an exception if the entity wasn't found, then the situation would be different.</p> <p>Something like <code>oq.checkMove(objToUpdate.getId())</code> could make sense. That would eliminate the <code>if</code> and make the code more expressive.</p>