public void setDefaultGroup(Experimenter user, ExperimenterGroup group) { if (user == null) return; if (group == null) return;  if (group.getId() == null) { throw new ApiUsageException("Group argument to setDefaultGroup " + "must be managed (i.e. have an id)"); }  boolean newDefaultSet = false; Experimenter foundUser = getExperimenter(user.getId()); for (GroupExperimenterMap map : (List<GroupExperimenterMap>) foundUser.collectGroupExperimenterMap(null)) { if (map.parent().getId().equals(group.getId())) { map.setDefaultGroupLink(Boolean.TRUE); newDefaultSet = true; } else { map.setDefaultGroupLink(Boolean.FALSE); }
public void setDefaultGroup(Experimenter user, ExperimenterGroup group) { if (user == null) return; if (group == null) return;  if (group.getId() == null) { throw new ApiUsageException("Group argument to setDefaultGroup " + "must be managed (i.e. have an id)");
    public void setDefaultGroup(Experimenter user, ExperimenterGroup group)    {        if (user == null) return;        if (group == null) return;                if (group.getId() == null)         {        	throw new ApiUsageException("Group argument to setDefaultGroup " +        			"must be managed (i.e. have an id)");        }                boolean newDefaultSet = false;        Experimenter foundUser = getExperimenter(user.getId());        for (GroupExperimenterMap map : (List<GroupExperimenterMap>)        		foundUser.collectGroupExperimenterMap(null))        {        	if (map.parent().getId().equals(group.getId()))        	{        		map.setDefaultGroupLink(Boolean.TRUE);        		newDefaultSet = true;        	}        	else         	{        		map.setDefaultGroupLink(Boolean.FALSE);        	}		}                if ( ! newDefaultSet)        {        	throw new ApiUsageException("Group "+group.getId()+" was not " +        			"found for user "+user.getId());        }                iUpdate.flush();    }