public function moveUsersToAlternativeGroups($userIdGroupIdMapping)
    {
        $affectedUsers = 0;
        $affectedGroups = [];
        foreach ($userIdGroupIdMapping as $userId => $groupId) {
            $affectedUsers += $this->UsersGroups->updateAll([
                'group_id' => $groupId
            ], [
                'user_id' => $userId
            ]);
            if (!in_array($groupId, $affectedGroups)) {
                $affectedGroups[] = $groupId;
            }
        }
        if ($affectedUsers > 0 && !empty($affectedGroups)) {
            $this->updateUserCount($affectedGroups);
        }
        return $affectedUsers;
    }