implement multi-group assigner and add tests