SONARJAVA-609 FP S1608 compare Class instances with ==
Small refactoring