code: public void writeJSON(String filePath, JsonConverter<SolutionType> solutionJsonConverter) throws IOException{
          
          /**************************************************/
          /* STEP 1: Convert results to JSON representation */
          /**************************************************/
          
          Json resultsJson = Json.object();
          
          // register problems
          results.forEach((problemID, searches) -> {
          
              Json problemJson = Json.object();
              
              searches.forEach((searchID, runs) -> {
              
                  Json searchJson = Json.array();
                  
                  // register search runs
                  runs.forEach(run -> {
                  
                      Json runJson = Json.object();
                      
                      // register update times and values
                      Json times = Json.array(run.getTimes().toArray());
                      Json values = Json.array(run.getValues().toArray());           
                      runJson.set("times", times);
                      runJson.set("values", values);
                      // register best found solution, if a JSON converter is given
                      if(solutionJsonConverter != null){
                          runJson.set("best.solution", solutionJsonConverter.toJson(run.getBestSolution()));
                      }
                      
                      searchJson.add(runJson);
                  
                  });
                  
                  problemJson.set(searchID, searchJson); 
              
              });
              
              resultsJson.set(problemID, problemJson);
          
          });
          
          
          /*************************************/
          /* STEP 2: Write JSON string to file */
          /*************************************/
          
          Files.write(Paths.get(filePath), Collections.singleton(resultsJson.toString()));
          
      }
docs: Write the results to a JSON file that can be loaded into R to be inspected and visualized using
  the james-analysis R package. If the specified file already exists, it is overwritten. This method
  stores the evaluation values, the update times and the actual best found solution for each search
  run. The solutions are converted to a JSON representation using the given converter. If the latter
  is <code>null</code>, the actual solutions are not stored in the output file.
  
  @param filePath path of the file to which the JSON output is written
  @param solutionJsonConverter converts solutions to a JSON representation
  @throws IOException if an I/O error occurs when writing to the file