Returns the groups the entity belongs to, null if none.
Iterable<String>? getGroups(Entity entity) => _groupsByEntity[entity];