<commit_before>package net.masterthought.cucumber;

import com.google.gson.Gson;
import net.masterthought.cucumber.json.Feature;
import net.masterthought.cucumber.util.Util;

import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ReportParser {

    private Map<String, List<Feature>> jsonReportFiles;

    public ReportParser(List<String> jsonReportFiles) throws IOException {
      this.jsonReportFiles = parseJsonResults(jsonReportFiles);
    }

    public Map<String, List<Feature>> getFeatures(){
      return jsonReportFiles;
    }

    private Map<String, List<Feature>> parseJsonResults(List<String> jsonReportFiles) throws IOException {
           Map<String, List<Feature>> featureResults = new HashMap<String, List<Feature>>();
           for (String jsonFile : jsonReportFiles) {
               String fileContent = Util.readFileAsString(jsonFile);
               if(Util.isValidCucumberJsonReport(fileContent)){
               Feature[] features = new Gson().fromJson(Util.U2U(fileContent), Feature[].class);
               featureResults.put(jsonFile, Arrays.asList(features));
               }
           }
           return featureResults;
       }

}
<commit_msg>ReportParser now stores featureResults using a LinkedHashMap rather than HashMap; Maintaining the order of inertion should prevent unit tests from failing randomly<commit_after>package net.masterthought.cucumber;

import com.google.gson.Gson;
import net.masterthought.cucumber.json.Feature;
import net.masterthought.cucumber.util.Util;

import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class ReportParser {

    private Map<String, List<Feature>> jsonReportFiles;

    public ReportParser(List<String> jsonReportFiles) throws IOException {
      this.jsonReportFiles = parseJsonResults(jsonReportFiles);
    }

    public Map<String, List<Feature>> getFeatures(){
      return jsonReportFiles;
    }

    private Map<String, List<Feature>> parseJsonResults(List<String> jsonReportFiles) throws IOException {
           Map<String, List<Feature>> featureResults = new LinkedHashMap<String, List<Feature>>();
           for (String jsonFile : jsonReportFiles) {
               String fileContent = Util.readFileAsString(jsonFile);
               if(Util.isValidCucumberJsonReport(fileContent)){
               Feature[] features = new Gson().fromJson(Util.U2U(fileContent), Feature[].class);
               featureResults.put(jsonFile, Arrays.asList(features));
               }
           }
           return featureResults;
       }

}

{'fraction_non_alphanumeric': 0.0978422619047619, 'fraction_numerical': 0.000744047619047619, 'mean_word_length': 3.557627118644068, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5323047', 'n_tokens_mistral': 730, 'n_tokens_neox': 722, 'n_words': 157}