@Test
public void testWritePairsToXML2()
{
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
LearnerGraph gr = buildLearnerGraph("A-a->A-b->B-c->C", "testWritePairsToXML1",config);
PairOfPaths pair1 = new PairOfPaths(gr,new PairScore(gr.findVertex(VertexID.parseID("A")), gr.findVertex(VertexID.parseID("C")),1,2)),
pair2 = new PairOfPaths(gr,new PairScore(gr.findVertex(VertexID.parseID("B")), gr.findVertex(VertexID.parseID("C")),1,2));
List<PairOfPaths> list = new LinkedList<PairOfPaths>();list.add(pair1);list.add(pair2);
PairOfPaths.writePairs(list, config, outputStream);
// Now load this.
System.out.println(outputStream);
List<PairOfPaths> loaded = PairOfPaths.readPairs(new StringReader(outputStream.toString()), config);
Assert.assertEquals(2,loaded.size());
PairOfPaths r=loaded.get(0);
Assert.assertEquals("A",gr.getVertex(r.getQ()).getID().toString());Assert.assertEquals("C",gr.getVertex(r.getR()).getID().toString());
r=loaded.get(1);
Assert.assertEquals("B",gr.getVertex(r.getQ()).getID().toString());Assert.assertEquals("C",gr.getVertex(r.getR()).getID().toString());
}