Uhm, at this point I don't know if that's me not being able to understand subtle differences of meaning, not being a native english speaker.
What you're saying is that if we accept that this sentence
If two distinct Resource objects are considered to be equal, their 'data' fields must have contained the same string value.
has the very same meaning of this one
If the call to the equals method does return true for two distinct Resource objects, their 'data' fields must have contained the same string value.
then it is true.
To be honest, I'm not so sure about this interpretation, but let's assume that's the right one.
Well, in this case this would be a tricky answer, and false too, in my opinion. It's tricky because, not being equals()
overridden, two distinct Resource objects will be equal (according to Object.equals()
implementation) only if they are.... well, the same object, not two distinct! In this case it is impossible for two distinct objects to be equal.
Furthermore, I think my example just simplify the one in the question: it's a class with an instance variable that does not ovveride Object.equals() method.
PS: please, I don't want to appear polemic or pedantic, it's just that I enjoy these kinds of discussions and exchange of opinions, and that's great having a forum like this linked to tests!