if (getLessonInstancesSet().contains(lessonInstance)) {
removeLessonInstances(lessonInstance);
}
Space space = getSpace();
//final ExecutionCourse executionCourse = lessonInstance.getLesson().getExecutionCourse();
if (/*!space.isOccupiedByExecutionCourse(executionCourse, lessonInstance.getBeginDateTime(),
lessonInstance.getEndDateTime())
&&*//*!space.isFree(lessonInstance.getDay(), lessonInstance.getDay(), lessonInstance.getStartTime(),
lessonInstance.getEndTime(), lessonInstance.getDayOfweek(), null, null, null)*/
!space.isFree(Lists.newArrayList(new Interval[] { new Interval(lessonInstance.getBeginDateTime(), lessonInstance
.getEndDateTime()) }))) {
throw new DomainException("error.LessonInstanceSpaceOccupation.room.is.not.free", space.getName(), lessonInstance
.getDay().toString("dd-MM-yy"));
}
addLessonInstances(lessonInstance);
}