title: Why you should never use synchronized on Optional java object
body: <p>I m learning about java optional wrapper, to do so I m reading the following <a href="https://dzone.com/articles/using-optional-correctly-is-not-optional" rel="noreferrer">tutorial</a></p>
  
  <p>however I have a simple question that is not answered in the article: in <strong>item 25: Avoid Using Identity-Sensitive Operations on Optionals</strong> they are mentioning to <strong>NEVER</strong> use an optional object in a synchronized way like this:</p>
  
  <pre><code>Optional&lt;Product&gt; product = Optional.of(new Product());
  
  synchronized(product) {
  
      ...
  
  }
  </code></pre>
  
  <p>but there is no explanation why, so please would any one here  explain to me why this is a bad  practice ???</p>