anchor.diff:                  .penalize("Room conflict", HardSoftScore.ONE_HARD);
       }
   
  -    private Constraint teacherConflict(ConstraintFactory constraintFactory) {
  +    Constraint teacherConflict(ConstraintFactory constraintFactory) {
           // A teacher can teach at most one lesson at the same time.
  -        return constraintFactory.from(Lesson.class)
  +        return constraintFactory.forEach(Lesson.class)
                   .join(Lesson.class,
                           Joiners.equal(Lesson::getTimeslot),
                           Joiners.equal(Lesson::getTeacher),
  
positive.code:         };
      }
  
      private Constraint roomConflict(ConstraintFactory constraintFactory) {
          // A room can accommodate at most one lesson at the same time.
  
          // Select a lesson ...
          return constraintFactory
                  .from(Lesson.class)
                  // ... and pair it with another lesson ...
                  .join(Lesson.class,
                          // ... in the same timeslot ...
  
negative.code:                 .penalize("Teacher conflict", HardSoftScore.ONE_HARD);
      }
  
      Constraint studentGroupConflict(ConstraintFactory constraintFactory) {
          // A student can attend at most one lesson at the same time.
          return constraintFactory.forEach(Lesson.class)
                  .join(Lesson.class,
                          Joiners.equal(Lesson::getTimeslot),
                          Joiners.equal(Lesson::getStudentGroup),
  