final TripleHandler th = mock(TripleHandler.class);
final ExtractionContext extractionContext = new ExtractionContext(
extractor.getDescription().getExtractorName(),
new URIImpl("http://fake.document.uri")
);
final ExtractionResult er = new ExtractionResultImpl(extractionContext, extractor, th);
er.notifyIssue(IssueReport.IssueLevel.Fatal , "Fake fatal error.", 1, 2);
er.notifyIssue(IssueReport.IssueLevel.Error , "Fake error." , 3, 4);
er.notifyIssue(IssueReport.IssueLevel.Warning, "Fake warning." , 5, 6);
ExtractionException ee = new ExtractionException("Fake message.", new RuntimeException("Fake cause"), er);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ee.printStackTrace(new PrintWriter(baos));
final String bufferContent = baos.toString();