throw new DomainException("error.candidacy.already.created");
StudentCandidacy existentCandidacy = person .getStudentCandidacyForExecutionDegree(executionDegree); if (!existentCandidacy.hasRegistration() || !(existentCandidacy.getRegistration().getActiveStateType().equals( RegistrationStateType.CANCELED) || existentCandidacy.getRegistration() .getActiveStateType().equals(RegistrationStateType.ABANDONED))) throw new DomainException("error.candidacy.already.created");
    protected void init(Person person, ExecutionDegree executionDegree) {	if (executionDegree == null) {	    throw new DomainException("execution degree cannot be null");	}	if (person == null) {	    throw new DomainException("person cannot be null");	}	if (person.hasStudentCandidacyForExecutionDegree(executionDegree)) {	    throw new DomainException("error.candidacy.already.created");	}	setExecutionDegree(executionDegree);	setPerson(person);	setPrecedentDegreeInformation(new PrecedentDegreeInformation());    }