if (periodHardConstraint.getPeriodHardConstraintType() == PeriodHardConstraintType.EXAM_COINCIDENCE) {
Exam leftExam = topicToExamMap.get(periodHardConstraint.getLeftSideTopic());
Exam rightExam = topicToExamMap.get(periodHardConstraint.getRightSideTopic());
Set<Exam> newCoincidenceExamSet = new LinkedHashSet<Exam>(4);
ExamCoincidence leftExamCoincidence = leftExam.getExamCoincidence();
if (leftExamCoincidence != null) {
newCoincidenceExamSet.addAll(leftExamCoincidence.getCoincidenceExamSet());
} else {
newCoincidenceExamSet.add(leftExam);
}
ExamCoincidence rightExamCoincidence = rightExam.getExamCoincidence();
if (rightExamCoincidence != null) {
newCoincidenceExamSet.addAll(rightExamCoincidence.getCoincidenceExamSet());
} else {
newCoincidenceExamSet.add(rightExam);
}
ExamCoincidence newExamCoincidence = new ExamCoincidence(newCoincidenceExamSet);
for (Exam exam : newCoincidenceExamSet) {
exam.setExamCoincidence(newExamCoincidence);
}
} else if (periodHardConstraint.getPeriodHardConstraintType() == PeriodHardConstraintType.AFTER) {
Exam afterExam = topicToExamMap.get(periodHardConstraint.getLeftSideTopic());