@Test
public void testHierarchicalMerge() throws IOException {

  ReportEvent e1 = new ReportEvent("test");
  e1.setLongMetric("another", 12345);
  e1.setLongMetric("duplicateLong", 23456);
  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 + " + 2  metrics");
  e.hierarchicalMerge("event1", e1);
  e.toJson(out);
  out.flush();
  assertEquals(attrs + 2, e.getNumMetrics());
  assertEquals(e.getLongMetric("event1.another"), Long.valueOf(12345L));
  assertEquals(e.getLongMetric("event1.duplicateLong"), Long.valueOf(54321L));
}