<p>Inexperienced Java developers might expect the <code>Object.equals(Object obj)</code> method to correctly handle the case where the left hand side is null, but that is not the case.</p>

<h2>Noncompliant Code Example</h2>
<pre>
if (variable.equals(null)) { /* ... */ }   // Noncompliant - "variable" is really null, a NullPointerException is thrown
</pre>

<h2>Compliant Solution</h2>
<pre>
if (variable == null) { /* ... */ }        // Compliant
</pre>