person.getPersonRoles().remove(person.getPersonRole(RoleType.MASTER_DEGREE_CANDIDATE));
person.removeRoleByType(RoleType.MASTER_DEGREE_CANDIDATE);
    public InfoCandidateRegistration run(Integer candidateID, Integer branchID, Integer studentNumber,            IUserView userView) throws FenixServiceException, ExcepcaoPersistencia {        MasterDegreeCandidate masterDegreeCandidate = rootDomainObject                .readMasterDegreeCandidateByOID(candidateID);        Person person = masterDegreeCandidate.getPerson();        Student student = person.getStudentByType(DegreeType.MASTER_DEGREE);        checkCandidateSituation(masterDegreeCandidate.getActiveCandidateSituation());        // remove master degree candidate role        person.getPersonRoles().remove(person.getPersonRole(RoleType.MASTER_DEGREE_CANDIDATE));        // check if old student number is free        checkOldStudentNumber(studentNumber, person);        // create new student        if (student == null) {            student = createNewStudent(studentNumber, person);        }        checkDuplicateStudentCurricularPlan(masterDegreeCandidate, student);        StudentCurricularPlan studentCurricularPlan = createNewStudentCurricularPlan(student, branchID,                masterDegreeCandidate);        createEnrolments(userView, masterDegreeCandidate, studentCurricularPlan);        updateCandidateSituation(masterDegreeCandidate);        copyQualifications(masterDegreeCandidate, person);        createGratuitySituation(masterDegreeCandidate, studentCurricularPlan);        return createNewInfoCandidateRegistration(masterDegreeCandidate, studentCurricularPlan);    }