def METHOD_NAME(self):
    client = self.new_client()
    admin = client.sf.getAdminService()
    assert 2 == len(admin.getEventContext().memberOfGroups)
    # AS ROOT: adding user to extra group
    admin_root = self.root.sf.getAdminService()
    exp = admin_root.getExperimenter(admin.getEventContext().userId)
    grp = self.new_group()
    admin_root.addGroups(exp, [grp])
    assert 3 == len(admin.getEventContext().memberOfGroups)
    proxies = dict()
    # creating stateful services
    proxies['search'] = client.sf.createSearchService()
    proxies['thumbnail'] = client.sf.createThumbnailStore()
    proxies['admin'] = client.sf.getAdminService()
    # changing group
    for k in list(proxies.keys()):
        try:
            proxies[k].close()
        except AttributeError:
            pass
    client.sf.setSecurityContext(
        omero.model.ExperimenterGroupI(grp.id.val, False))
    admin.setDefaultGroup(admin.getExperimenter(
        admin.getEventContext().userId),
        omero.model.ExperimenterGroupI(grp.id.val, False))
    assert grp.id.val == \
        client.sf.getAdminService().getEventContext().groupId