### Question:
TextReportWriter extends AbstractReportWriter { @Override public void writeReport(Writer writer, HtmlPage htmlPage, RuleSet ruleSet, Violations violations) { PrintWriter out = new PrintWriter(writer); printTitle(htmlPage, out); printViolations(violations, out); printRules(ruleSet, out); out.flush(); } TextReportWriter(); @Override void writeReport(Writer writer, HtmlPage htmlPage, RuleSet ruleSet, Violations violations);  }### Answer:
@Test public void writesToConsole() throws Exception { TextReportWriter writer = new TextReportWriter(); writer.setWriteToFile(false); writer.writeReport(someHtmlPage(), someRuleSet(), someViolations()); validateOutput(getConsoleOutput()); }