Add entity and id comparators. Store entity id in Entity just as we put a reference there to the collection.