title: Can anything warn me against type.equals(incompatibleType)?
body: <p>Is there any tool that can warn me against the following sort of code:</p>
  
  <pre><code>if ( someClass.equals( someString ))
  </code></pre>
  
  <p>For example:</p>
  
  <pre><code>if ( myObject.getClass().equals( myClassName ))
  </code></pre>
  
  <p>Such a thing is legal Java (equals takes an Object) but will never evaluate to true (a class can never equal a String) so is almost certainly a bug.</p>
  
  <p>I have checked Eclipse, FindBugs and PMD but none seem to support this feature?</p>