I got this problem. I am working with different objects that belong to different classes. What I am trying to do is to see if a object is equal or not to another one that is possibly inside another object using a recursive algorithm:

And I want to see if a Object of the Assignment class is inside or not the group:

Assignment
Group [Assignment, Keyword]

As you can see, inside the Group object there is a list with the object that I want to find. In this case I am having the next output:

The objects are not the same:
Assignment
Group [Assignment, Keyword]
The objects are the same:
Assignment
Assignment
The objects are not the same:
Assignment
Keyword

Which is right. The problem is, when the initial group gets another Assignment element

Group [Assignment, Keyword, Assignment]

the algorithm does not see the corresponding match and provides an output like this:

The objects are not the same:
Assignment
Group [Assignment, Keyword, Assignment]
The objects are not the same:
Assignment
Assignment
The objects are not the same:
Assignment
RuleCall
The objects are not the same:
Assignment
Keyword
The objects are not the same:
Assignment
Assignment
The objects are not the same:
Assignment
RuleCall

But in my case the second pair of elements are the same (that is why I am using ECoreUtil.equals). Any idea about why this could be happening?

EcoreUtil.equals is far from being a foolproof mean of comparing EObjects. What it does is compare structurally and return true if the two objects have the same EClass and equal features. With this in mind, you will most likely have false positives ... and you will also easily have wrong reports of "equal" elements being reported as "different".

EMF Compare 2 would be able to meet your needs here, or you can try subclassing EcoreUtil.EqualityHelper to suit your needs, though that does not seem like an easy endeavour.