}
// Replay all nodes and their attributes.
for (Node node : graph) {
Node n = this.graph.addNode(node.getId());
if (node.getAttributeKeySet() != null) {
for (String key : node.getAttributeKeySet()) {
n.addAttribute(key, node.getAttribute(key));
}
}
}
// Replay all edges and their attributes.