for (final LessonInstance lessonInstance : getLessonInstancesSet()) {
if (lessonInstance.getDay().isAfter(new LocalDate())) {
if (newRoom == null) {
lessonInstance.setLessonInstanceSpaceOccupation(null);
} else {
LessonInstanceSpaceOccupation allocation =
(LessonInstanceSpaceOccupation) SpaceUtils.getFirstOccurrenceOfResourceAllocationByClass(newRoom,
this);
if (allocation == null) {
allocation = new LessonInstanceSpaceOccupation(newRoom);
}
allocation.edit(lessonInstance);
}
}
}
}