{
LearnerGraphND graph = buildLearnerGraphND("A-a->B-a-#C\nA-d-#D\nA-c->A\nA-a->S-a->S","testWriteAndLoad5",Configuration.getDefaultConfiguration(), converter);
graph.findVertex("B").setDepth(5);graph.findVertex("D").setColour(JUConstants.AMBER);
graph.addToCompatibility(graph.findVertex("A"), graph.findVertex("B"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
ChangesRecorder patcher = new ChangesRecorder(null);
patcher.addTransition(graph.findVertex("B"), AbstractLearnerGraph.generateNewLabel("c", cloneConfig,converter), graph.findVertex("B"));
patcher.removeTransition(graph.findVertex("A"), label_a, graph.findVertex("B"));
patcher.removeFromCompatibility(graph.findVertex("B"), graph.findVertex("A"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
patcher.addToCompatibility(graph.findVertex("B"), graph.findVertex("S"),JUConstants.PAIRCOMPATIBILITY.INCOMPATIBLE);
patcher.addTransition(graph.findVertex("A"), label_q, graph.findVertex("B"));
patcher.setInitial(graph.findVertex("A"));
patcher.addRelabelling(VertexID.parseID("A"), VertexID.parseID("U"));
patcher.addRelabelling(VertexID.parseID("C"), VertexID.parseID("R"));
CmpVertex danglingVertex = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID("TEST"), cloneConfig);
danglingVertex.setColour(JUConstants.BLUE);
patcher.addVertex(danglingVertex);
Configuration config = Configuration.getDefaultConfiguration().copy();config.setLearnerCloneGraph(false);
LearnerGraphMutator<List<CmpVertex>,LearnerGraphNDCachedData> graphPatcher = new LearnerGraphMutator<List<CmpVertex>,LearnerGraphNDCachedData>(graph,config,null);
ChangesRecorder.loadDiff(graphPatcher, patcher.writeGD(createDoc()), converter);
graphPatcher.removeDanglingStates();
LearnerGraphND result = new LearnerGraphND(Configuration.getDefaultConfiguration());
graphPatcher.relabel(result);
LearnerGraphND expected = buildLearnerGraphND("U-q->B-a-#R\nU-d-#D\nU-c->U\nB-c->B\nU-a->S-a->S","testWriteAndLoad1",Configuration.getDefaultConfiguration(), converter);