public void printGraph(Writer w) throws Exception {
        for(Entry<Value, HashSet<Value>> v  : adjacencyList.entrySet()) {
            Value node = v.getKey();
            HashSet<Value> edges = v.getValue();
            // first write the node so that nodes that have no edges
            // connecting them will be drawn.
            w.write("\"");
            node.printAsArg(w);
            w.write("\";\n");
            for(Value endpoint : edges) {
                w.write("\"");
                node.printAsArg(w);
                w.write("\" -- \"");
                endpoint.printAsArg(w);
                w.write("\";\n");
            }
        }
    }