}
private static void copyProfessorships(final ExecutionCourse executionCourseFrom, final ExecutionCourse executionCourseTo)
throws MaxResponsibleForExceed, InvalidCategory {
for (; !executionCourseFrom.getProfessorshipsSet().isEmpty();) {
final Professorship professorship = executionCourseFrom.getProfessorshipsSet().iterator().next();
Professorship otherProfessorship = findProfessorShip(executionCourseTo, professorship.getPerson());
if (otherProfessorship == null) {
otherProfessorship =
Professorship.create(professorship.getResponsibleFor(), executionCourseTo, professorship.getPerson(),
professorship.getHours());
}
for (; !professorship.getAssociatedSummariesSet().isEmpty(); otherProfessorship.addAssociatedSummaries(professorship
.getAssociatedSummariesSet().iterator().next())) {
;
}
for (; !professorship.getAssociatedShiftProfessorshipSet().isEmpty(); otherProfessorship
.addAssociatedShiftProfessorship(professorship.getAssociatedShiftProfessorshipSet().iterator().next())) {
;
}
}
}