public void testPatchGeneratesDeepCopiesOfInternalState()
{
PatchTreeRecorder<PatchTreeTestModel> pc = makeOne();
PatchTreeTestModel restCommonTestModel = pc.getRecordingProxy();
restCommonTestModel.setFooRecordTemplate(new FooRecordTemplate().setBar(10l));
PatchTree pt1 = pc.generatePatchTree();
restCommonTestModel.setFooRecordTemplate(new FooRecordTemplate().setBar(20l));
PatchTree pt2 = pc.generatePatchTree();
Assert.assertNotEquals(pt1.getDataMap(), pt2.getDataMap());
Assert.assertEquals(pt1.getDataMap(),
diffEmpty(new PatchTreeTestModel().setFooRecordTemplate(new FooRecordTemplate().setBar(10l))));
Assert.assertEquals(pt2.getDataMap(),
diffEmpty(new PatchTreeTestModel().setFooRecordTemplate(new FooRecordTemplate().setBar(20l))));
}