if (selectedLessons == null || selectedLessons.length == 0) {
return goToInsertComplexSummaryAgain(request, mapping, response, form);
} else if (selectedLessons != null && selectedLessons.length != 0) {
boolean uniqueType = true;
ShiftType shiftType = null;
List<NextPossibleSummaryLessonsAndDatesBean> nextPossibleLessonsDates =
new ArrayList<NextPossibleSummaryLessonsAndDatesBean>();
for (String lessonRepresentation : selectedLessons) {
NextPossibleSummaryLessonsAndDatesBean nextLesson =
NextPossibleSummaryLessonsAndDatesBean.getNewInstance(lessonRepresentation);
if (nextLesson.getLesson().getShift().getCourseLoadsSet().size() == 1) {
nextLesson.setLessonType(nextLesson.getLesson().getShift().getCourseLoadsSet().iterator().next().getType());
}
nextPossibleLessonsDates.add(nextLesson);
ShiftType lessonType = null;
if (nextLesson.getLesson().getShift().getCourseLoadsSet().size() == 1) {
lessonType = nextLesson.getLesson().getShift().getCourseLoadsSet().iterator().next().getType();
if (shiftType == null) {
shiftType = lessonType;
} else if (!shiftType.equals(lessonType)) {