code: public void setRoles(final JAASSystem _jaasSystem,
                           final Set<Role> _roles)
          throws EFapsException
      {
  
          if (_jaasSystem == null) {
              throw new EFapsException(getClass(), "setRoles.nojaasSystem", getName());
          }
          if (_roles == null) {
              throw new EFapsException(getClass(), "setRoles.noRoles", getName());
          }
  
          for (final Role role : _roles) {
              add(role);
          }
  
          // current roles
          final Set<Role> rolesInDb = getRolesFromDB(_jaasSystem);
  
          // compare new roles with current roles (add missing roles)
          for (final Role role : _roles) {
              if (!rolesInDb.contains(role)) {
                  assignRoleInDb(_jaasSystem, role);
              }
          }
  
          // compare current roles with new roles (remove roles which are to much)
          for (final Role role : rolesInDb) {
              if (!_roles.contains(role)) {
                  unassignRoleInDb(_jaasSystem, role);
              }
          }
      }
docs: The depending roles for the user are set for the given JAAS system. All
  roles are added to the loaded roles in the cache of this person.
  
  @param _jaasSystem JAAS system for which the roles are set
  @param _roles set of roles to set for the JAAS system
  @see #assignRoleInDb
  @see #unassignRoleInDb
  @throws EFapsException from calling methods