}
});
for (Map.Entry<? extends CompilationUnitTree, Optional<? extends CompilationUnitTree>>
matchedTreePair : matchedTrees.entrySet()) {
final CompilationUnitTree expectedTree = matchedTreePair.getKey();
if (!matchedTreePair.getValue().isPresent()) {
failNoCandidates(expectedTreeTypes.get(expectedTree), expectedTree,
actualTreeTypes, actualTrees);
} else {
CompilationUnitTree actualTree = matchedTreePair.getValue().get();
TreeDifference treeDifference = TreeDiffer.diffCompilationUnits(expectedTree, actualTree);
if (!treeDifference.isEmpty()) {
String diffReport = treeDifference.getDiffReport(
new TreeContext(expectedTree, expectedResult.trees()),
new TreeContext(actualTree, actualResult.trees()));
failWithCandidate(expectedTree.getSourceFile(), actualTree.getSourceFile(), diffReport);
}
}
}
}