{
groupName = ValidationUtils.assertNotEmpty(groupName, "groupName cannot be empty");
groupType = ValidationUtils.assertNotEmpty(groupType, "groupType cannot be empty");
if (findByNameAndType(groupName, groupType) != null)
throw new DuplicateUserGroupException("group already exists: " + groupName + "/" + groupType);
UserGroup userGroup = new UserGroup(groupName, groupType);
return userGroupDao.save(userGroup);
}