if (enrolment.getCurricularCourse().getCompetenceCourse().getDepartmentsSet() .contains(getDepartment())) {
if (enrolment.getCurricularCourse().hasCompetenceCourse() && enrolment.getCurricularCourse().getCompetenceCourse().getDepartmentsSet() .contains(getDepartment())) {
    public boolean isMember(Person person) {	if (person != null && person.hasStudent()) {	    for (final Registration registration : person.getStudent().getRegistrationsSet()) {		for (final Enrolment enrolment : registration.getLastStudentCurricularPlan()			.getEnrolmentsByExecutionYear(getExecutionYear())) {		    if (enrolment.getCurricularCourse().getCompetenceCourse().getDepartmentsSet()			    .contains(getDepartment())) {			return true;		    }		}	    }	}	return false;    }