@Test
public void testEquivalence() throws Exception {

  final List<Incident> incidents = Arrays.asList(mkIncident(1), mkIncident(2));
  final List<IncidentTree> subTrees = Collections.singletonList(new IncidentTreeImpl(
          Arrays.asList(mkIncident(3), mkIncident(4)),
          Collections.emptyList()));
  final JaxbIncidentTree dto = new JaxbIncidentTree(new IncidentTreeImpl(incidents, subTrees));
  final IncidentTree tree = dto.toIncidentTree();
  run(IncidentTree.class, new IncidentTree() {
    @Override public List<Incident> getIncidents() {
      assertEquals("incidents transferred", incidents, tree.getIncidents());
      return null;
    }
    @Override public List<IncidentTree> getDescendants() {
      assertEquals("childIncidents transferred", subTrees, tree.getDescendants());
      return null;
    }
  });
}