private static Map<GraphSet, Map<Algorithm, BenchmarkResult>> constructGraphAlgorithmResults( BenchmarkSuiteResult benchmarkSuiteResult) { // Construct a map of maps to hold the results Map<GraphSet, Map<Algorithm, BenchmarkResult>> graphAlgorithmResults = new HashMap<>(); for (GraphSet graph : benchmarkSuiteResult.getBenchmarkSuite().getGraphSets()) { graphAlgorithmResults.put(graph, new HashMap<Algorithm, BenchmarkResult>()); } // Insert the results from the benchmark suite for (BenchmarkResult benchmarkResult : benchmarkSuiteResult.getBenchmarkResults()) { graphAlgorithmResults .get(benchmarkResult.getBenchmark().getGraph().getGraphSet()) .put(benchmarkResult.getBenchmark().getAlgorithm(), benchmarkResult); } // Make the map unmodifiable for (GraphSet graph : benchmarkSuiteResult.getBenchmarkSuite().getGraphSets()) { graphAlgorithmResults.put( graph, Collections.unmodifiableMap(graphAlgorithmResults.get(graph))); } return Collections.unmodifiableMap(graphAlgorithmResults); }