Test against `EntityInterface` instead of `self`

Classes consuming `EntityTrait` do not necessarily have to
extend `Entity`, testing against `self` would fail in various
cases, like for example when one of the compared objects
extends `Entity` and the other just implements `EntityInterface`.