What is the point of this article? I believe it's clear for everyone that you can not compare non-primitive objects by refetence to test if the values of such objects are equal. Objects should be compared by equals() or Objects.equals(). I prefer Objects.equals() because it's safe if one or both objects are null.