[#467] Fix return value of compareTo for the same objects

Fix compareTo behaviour the same objects