### Question:
ReportEvent extends EventImpl { public void merge(ReportEvent e) { super.merge(e); mergeWithPrefix("", e); } 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 testMerge() throws IOException { ReportEvent e1 = new ReportEvent("test"); e1.setLongMetric("another", 12345); long attrs = e.getNumMetrics(); System.out.println("- before merge, " + attrs + " attributes"); Writer out = new OutputStreamWriter(System.out); e.toJson(out); out.flush(); System.out.println("- after merge, " + attrs + " + 1 attributes"); e.merge(e1); e.toJson(out); out.flush(); assertEquals(attrs + 1, e.getNumMetrics()); }