### Question:
ReportEvent extends EventImpl { public void toHtml(Writer o) throws IOException { PrintWriter pw = new PrintWriter(o); pw.print("<table>"); pw.print("<tr>"); pw.print("<th>host</th>"); pw.print("<td>"); pw.print(getHost()); pw.println("</td>"); pw.print("</tr>"); SortedMap<String, String> reportAttrs = new TreeMap<String, String>(); for (String attr : getAttrs().keySet()) { reportAttrs.put(attr, Attributes.toString(this, attr)); } for (Entry<String, Long> e : getAllLongMetrics().entrySet()) { reportAttrs.put(e.getKey(), e.getValue().toString()); } for (Entry<String, Double> e : getAllDoubleMetrics().entrySet()) { reportAttrs.put(e.getKey(), e.getValue().toString()); } for (Entry<String, String> e : getAllStringMetrics().entrySet()) { reportAttrs.put(e.getKey(), e.getValue()); } for (Entry<String, String> a : reportAttrs.entrySet()) { pw.println("<tr><th>" + a.getKey() + "</th>"); pw.print("<td>"); pw.print("<div class=\"" + a.getKey() + "\">"); pw.print(a.getValue()); pw.print("</div>"); pw.println("</td>"); pw.println("</tr>"); } pw.print("</table>"); } ReportEvent(ReportEvent e);  ReportEvent(String src);  ReportEvent(Map<String, Long> longMetrics,
      Map<String, String> stringMetrics, Map<String, Double> doubleMetrics); void setLongMetric(String name, long value); void setDoubleMetric(String name, double value); void setStringMetric(String name, String value); Long getLongMetric(String name); Double getDoubleMetric(String name); String getStringMetric(String name); Map<String, Double> getAllDoubleMetrics(); Map<String, String> getAllStringMetrics(); Map<String, Long> getAllLongMetrics(); long getNumMetrics(); void toJson(Writer o); void toHtml(Writer o); String toString(); void toText(Writer o); static ReportEvent createLegacyHtmlReport(String name, String data); void merge(ReportEvent e); void hierarchicalMerge(String prefix, ReportEvent e); String toText(); String toJson(); String toHtml(); final static String R_NAME; final static String A_COUNT; }### Answer:
@Test public void testReportHtml() throws IOException { Writer w = new OutputStreamWriter(System.out); e.toHtml(w); w.flush(); }