GraphSerialization { private GraphSerialization() { } private  GraphSerialization(); static void saveGraph(DirectedGraph<Integer, DefaultEdge> graph, String location); static void saveGraph(DirectedGraph<Integer, DefaultEdge> graph, File file); static DirectedGraph<Integer, DefaultEdge> loadGraph(String location); static DirectedGraph<Integer, DefaultEdge> loadGraph(File file);  }
@Test public void testGraphSerialization() { try { CategoryGraph sourceGraph = CategoryGraphManager .getCategoryGraph(wiki); testGraph(sourceGraph.getGraph()); sourceGraph.saveGraph(serializationFileName); CategoryGraph loadedGraph = new CategoryGraph(wiki, new File( serializationFileName)); testGraph(loadedGraph.getGraph()); } catch (Exception e) { assumeNoException(e); } }