private BufferedImage buildGraphFromCollection(Map<String, String> graph) {
edu.uci.ics.jung.graph.UndirectedGraph g = new edu.uci.ics.jung.graph.impl.UndirectedSparseGraph();
Set<Entry<String, String>> entries = graph.entrySet();
for (Entry<String, String> entry : entries) {
Vertex v1 = new SparseVertex();
v1.addUserDatum("name", entry.getKey(), new UserDataContainer.CopyAction.Clone());
g.addVertex(v1);
Vertex v2 = new SparseVertex();
v2.addUserDatum("name", entry.getValue(), new UserDataContainer.CopyAction.Clone());
g.addVertex(v2);
Edge e = new UndirectedSparseEdge(v1, v2);
g.addEdge(e);
}
FRLayout l = new FRLayout(g);