private static void removeEvaluations(final ExecutionCourse executionCourseFrom, final ExecutionCourse executionCourseTo)
throws FenixServiceException {
while (!executionCourseFrom.getAssociatedEvaluationsSet().isEmpty()) {
final Evaluation evaluation = executionCourseFrom.getAssociatedEvaluationsSet().iterator().next();
if (evaluation instanceof FinalEvaluation) {
final FinalEvaluation finalEvaluationFrom = (FinalEvaluation) evaluation;
if (!finalEvaluationFrom.getMarksSet().isEmpty()) {
throw new FenixServiceException("Cannot merge execution courses: marks exist for final evaluation.");
} else {
finalEvaluationFrom.delete();
}
} else {
executionCourseTo.getAssociatedEvaluationsSet().add(evaluation);
executionCourseFrom.getAssociatedEvaluationsSet().remove(evaluation);
}