def METHOD_NAME(driver, user, super_admin_user, public_group, public_group2):
    driver.get(f'/become_user/{super_admin_user.id}')
    driver.get('/user_management')
    filter_for_user(driver, user.username)
    driver.wait_for_xpath(
        f"//*[@data-testid='deleteGroupUserButton_{user.id}_{public_group.id}']"
    )
    driver.click_xpath(f'//*[@data-testid="addUserGroupsButton{user.id}"]')
    driver.click_xpath('//*[@data-testid="addUserToGroupsSelect"]')
    driver.click_xpath(f'//li[text()="{public_group2.name}"]', scroll_parent=True)
    driver.click_xpath('//button[@data-testid="submitAddFromGroupsButton"]')
    driver.wait_for_xpath(
        '//*[text()="User successfully added to specified group(s)."]'
    )
    driver.wait_for_xpath(
        f"//*[@data-testid='deleteGroupUserButton_{user.id}_{public_group2.id}']"
    )