@Test
  public void testAllRecommenderSystemsFilePersistence()
      throws CannotLoadRatingsDataset, CannotLoadContentDataset {
    final List<RecommenderSystem> recommenderSystems =
        RecommenderSystemsFactory.getInstance().getAllClasses(RecommenderSystem.class);

    for (RecommenderSystem recommenderSystem : recommenderSystems) {
      if (recommenderSystem instanceof Recommender_DatasetProperties) {
        continue;
      }

      String configFile = TEST_DIRECTORY + recommenderSystem.getName() + "_config.xml";

      RecommenderSystemConfigurationFileParser.saveConfigFile(
          configFile,
          recommenderSystem,
          datasetLoader,
          new FilePersistence(recommenderSystem.getName(), "dat", new File(TEST_DIRECTORY)),
          new OnlyNewItems(),
          getRecommendationOutputFileXML(recommenderSystem));

      Chronometer chronometer = new Chronometer();
      SingleUserRecommendation.buildRecommendationModel(configFile);
      Global.showln(
          "Built model of '" + recommenderSystem + "' in " + chronometer.printTotalElapsed());

      RatingsDataset<? extends Rating> ratingsDataset = datasetLoader.getRatingsDataset();
      chronometer.reset();
      ratingsDataset
          .allUsers()
          .stream()
          .forEach(
              (idUser) -> {
                SingleUserRecommendation.recommendToUser(configFile, idUser);
              });
      Global.showln(
          "Recommended with '"
              + recommenderSystem
              + "' to "
              + datasetLoader.getRatingsDataset().allUsers().size()
              + " users in "
              + chronometer.printTotalElapsed());
    }
  }
 @Override
 public Set<Integer> getUserRated(Integer idUser) {
   if (!getUserRatingsWarningMessageShown) {
     RatingDatasetEfficiencyException ratingDatasetEfficiencyException =
         new RatingDatasetEfficiencyException(
             this.getClass().getSimpleName()
                 + ": Using an inefficient method:[getItemRated(Integer idItem):Collection<Integer>]");
     Global.showWarning(ratingDatasetEfficiencyException);
     getUserRatingsWarningMessageShown = true;
   }
   return getUserRatingsRated(idUser).keySet();
 }
 @Override
 public Map<Integer, RatingType> getUserRatingsRated(Integer idUser) {
   if (!getUserRatingsRatedWarningMessageShown) {
     RatingDatasetEfficiencyException ratingDatasetEfficiencyException =
         new RatingDatasetEfficiencyException(
             this.getClass().getSimpleName()
                 + ": Using an inefficient method:[getItemRatingsRated(Integer idItem):Map<Integer, Byte>]");
     Global.showWarning(ratingDatasetEfficiencyException);
     getUserRatingsRatedWarningMessageShown = true;
   }
   Map<Integer, RatingType> ret = new TreeMap<>();
   ratings_byItem
       .keySet()
       .stream()
       .filter((idItem) -> (ratings_byItem.get(idItem).containsKey(idUser)))
       .forEach(
           (idItem) -> {
             ret.put(idItem, ratings_byItem.get(idItem).get(idUser));
           });
   return ret;
 }
  private void printProgress(ExperimentProgress algorithmExperiment) {

    String experimentMessage =
        new Date().toString()
            + " => "
            + algorithmExperiment.getExperimentProgressTask()
            + " --> "
            + algorithmExperiment.getExperimentProgressPercent()
            + "% ";

    if (algorithmExperiment.getExperimentProgressRemainingTime() > 0) {
      experimentMessage =
          experimentMessage
              + "( remaining: "
              + DateCollapse.collapse(algorithmExperiment.getExperimentProgressRemainingTime())
              + " )";
    } else if (algorithmExperiment.getExperimentProgressRemainingTime() < 0) {
      experimentMessage = experimentMessage + "( remaining: unknown )";
    }

    Global.printStandard(experimentMessage + "\n");
  }
  /** Test of datasetDiff method, of class RatingsDatasetDiff. */
  @Test
  public void testDatasetDiff() {
    RatingsDataset<? extends Rating> oldRatingsDataset =
        RandomRatingsDatasetFactory.createRatingsDatasetWithLoadFactor(
            10, 20, 0.5, new DecimalDomain(1, 5), 654321);
    RatingsDataset<? extends Rating> newRatingsDataset =
        RandomRatingsDatasetFactory.createRatingsDatasetWithLoadFactor(
            10, 20, 0.5, new DecimalDomain(1, 5), 123456);

    Global.showln("=============================================================");
    Global.showln("===================== Old dataset ===========================");
    Global.showln("=============================================================");
    Global.showln(DatasetPrinter.printCompactRatingTable(oldRatingsDataset));
    Global.showln("=============================================================");
    Global.showln("===================== New dataset ===========================");
    Global.showln("=============================================================");
    Global.showln(DatasetPrinter.printCompactRatingTable(newRatingsDataset));
    Global.showln("=============================================================");
    Global.showln("===================== Diff old to new =======================");
    Global.showln("=============================================================");
    Global.showln(RatingsDatasetDiff.printDiff(oldRatingsDataset, newRatingsDataset));
    Global.showln("=============================================================");
    Global.showln("===================== Diff new to old =======================");
    Global.showln("=============================================================");
    Global.showln(RatingsDatasetDiff.printDiff(newRatingsDataset, oldRatingsDataset));
    Global.showln("=============================================================");
    Global.showln("===================== Diff histogram old to new =============");
    Global.showln("=============================================================");
    Global.showln(RatingsDatasetDiff.printDiffHistogram(newRatingsDataset, oldRatingsDataset));
    Global.showln("=============================================================");
    Global.showln("===================== Diff histogram new to old =============");
    Global.showln("=============================================================");
    Global.showln(RatingsDatasetDiff.printDiffHistogram(oldRatingsDataset, newRatingsDataset));
  }