for (final Professorship otherProfessorship : executionCourse.getProfessorshipsSet()) { if (teacher == otherProfessorship.getTeacher()) { throw new DomainException("error.teacher.already.associated.to.professorship"); } }
    public static Professorship create(Boolean responsibleFor, ExecutionCourse executionCourse,            Teacher teacher, Double hours) throws MaxResponsibleForExceed, InvalidCategory {        if (responsibleFor == null || executionCourse == null || teacher == null)            throw new NullPointerException();        Professorship professorShip = new Professorship();        professorShip.setHours((hours == null) ? new Double(0.0) : hours);        if (responsibleFor.booleanValue()) {            ResponsibleForValidator.getInstance().validateResponsibleForList(teacher, executionCourse,                    professorShip);        }        professorShip.setResponsibleFor(responsibleFor);        professorShip.setExecutionCourse(executionCourse);        professorShip.setTeacher(teacher);        return professorShip;    }