SONARJAVA-497 Object should be compared with equals

Handle also the != operator