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