title: Java FindBugs: Suspicious comparison of Long references
body: <p>FindBugs recognizes the following bug in my code:</p>
  
  <blockquote>
    <p>Suspicious comparison of Long references</p>
  </blockquote>
  
  <p>I have tried Googling this particular error but with no luck. As far as I know comparing fields of data type <code>Long</code> should be done with <code>==</code> operator. </p>
  
  <pre><code>if (materialDefinition.getId() == definitionToRemoveFromClass.getId()) {
      //...
  }
  </code></pre>
  
  <p>I am certain both methods <code>.getId()</code> return a <code>Long</code>.</p>
  
  <p>Is this really an issue and if so, how do I fix it?</p>