NodeProjector<FootballScores> scoresFactory = objectProjector(FootballScores.class);
@Test
public void simple() {
Heap src = new MutableHeap("src");
Heap target = new MutableHeap("target");
src.addListener(target.asListener(), false);
src.beginUpdate();
FootballScores scores = scoresFactory.project(src.ensureRoot(NodeType.OBJECT));
src.endUpdate();
Assert.assertEquals(src.toString(), target.toString());
src.beginUpdate();
scores.setAway(0);
scores.setHome(1);
GoalDetail firstGoal = scores.goals().addLast();
firstGoal.setScorer("Rooney");
firstGoal.setMinutes(34);
src.endUpdate();
Assert.assertEquals(src.toString(), target.toString());
src.beginUpdate();
scores.goals().clear();
src.endUpdate();
Assert.assertEquals(src.toString(), target.toString());
src.beginUpdate();
scores.clear();
src.endUpdate();
Assert.assertEquals(src.toString(), target.toString());
}