public SynchronizedGroupStatistic synchronizeCourse(CampusCourseImportTO sapCourse) {
    if (sapCourse != null) {
      long resourceableId = sapCourse.getOlatResourceableId();
      log.debug(
          "synchronizeCourse sapCourseId="
              + sapCourse.getSapCourseId()
              + "  resourceableId="
              + resourceableId);
      ICourse course = CourseFactory.loadCourse(resourceableId);
      commitDBImplTransaction();
      log.debug("synchronizeCourse start for course=" + course.getCourseTitle());
      log.debug("synchronizeCourse Lecturer size=" + sapCourse.getLecturers().size());
      log.debug("synchronizeCourse Participants size=" + sapCourse.getParticipants().size());

      courseGroupSynchronizer.addAllLecturesAsOwner(course, sapCourse.getLecturers());
      // SynchronizedGroupStatistic groupStatistic =
      // courseGroupSynchronizer.synchronizeCourseGroupsForStudentsOnly(course, sapCourse);
      SynchronizedGroupStatistic groupStatistic =
          courseGroupSynchronizer.synchronizeCourseGroups(course, sapCourse);
      commitDBImplTransaction();
      log.debug("synchronizeCourse statistic=" + groupStatistic);
      if (campusConfiguration.isSynchronizeTitleAndDescriptionEnabled()) {
        log.debug("SynchronizeTitleAndDescription is enabled");
        courseAttributeSynchronizer.synchronizeTitleAndDescription(
            sapCourse.getSapCourseId(), sapCourse);
        commitDBImplTransaction();
      }
      return groupStatistic;
    } else {
      return SynchronizedGroupStatistic.createEmptyStatistic();
    }
  }
  public PreviewCourseEnvironment(
      final ICourse course,
      final Date simulatedDateTime,
      final CoursePropertyManager cpm,
      final CourseGroupManager cgm,
      final UserNodeAuditManager auditman,
      final AssessmentManager am) {
    super();
    this.course = course;
    this.title = course.getCourseTitle();
    this.courseFolderContainer = course.getCourseFolderContainer();
    this.courseBaseContainer = course.getCourseBaseContainer();
    this.runStructure = course.getEditorTreeModel().createStructureForPreview();
    this.resourceablId = course.getResourceableId();

    this.simulatedDateTime = simulatedDateTime.getTime();
    this.coursePropertyManager = cpm;
    this.courseGroupManager = cgm;
    this.auditManager = auditman;
    this.assessmentManager = am;
  }