@Override
public Map<SourceLocation, List<fr.inria.lille.localization.TestResult>> getTestListPerStatement() {
Map<SourceLocation, List<fr.inria.lille.localization.TestResult>> results = new HashMap<>();
List<TestResult> testResults = this.getTestResults();
for (int j = 0; j < testResults.size(); j++) {
TestResult testResult = testResults.get(j);
TestResultImpl test = new TestResultImpl(TestCase.from(testResult.getName()), testResult.wasSuccessful());
List<ComponentCount> components = testResult.getCoveredComponents();
for (int i = 0; i < components.size(); i++) {
ComponentCount component1 = components.get(i);
Statement component = (Statement) component1.getComponent();
String containingClass = component.getMethod().getParent().getLabel();
SourceLocation sourceLocation = new SourceLocation(containingClass, component.getLineNumber());
if (!results.containsKey(sourceLocation)) {
results.put(sourceLocation, new ArrayList<fr.inria.lille.localization.TestResult>());
}
results.get(sourceLocation).add(test);
}
}
LinkedHashMap<SourceLocation, List<fr.inria.lille.localization.TestResult>> map = new LinkedHashMap<>();
for (StatementSourceLocation source : this.statements) {
map.put(source.getLocation(), results.get(source.getLocation()));
}
results = map;
return results;
}