### Question:
LightDTGraph implements DTGraph<L, T> { public String toString() { StringBuffer sb = new StringBuffer(); sb.append("digraph {"); Set<DNode<L>> nodes = new HashSet<DNode<L>>(nodes()); for(DLink<L> link : links()) { if(sb.length() != 9) sb.append("; "); sb.append(link); nodes.remove(link.first()); nodes.remove(link.second()); } for(DNode<L> node : nodes) sb.append("; " + node); sb.append("}"); return sb.toString(); } LightDTGraph();  LightDTGraph(int capacity); @Override Set<T> tags(); @Override int size(); @Override DTNode<L, T> node(L label); @Override Collection<? extends DTNode<L, T>> nodes(L label); @Override List<? extends DTNode<L, T>> nodes(); @Override DTNode<L, T> get(int i); @Override Iterable<? extends DTLink<L, T>> links(); @Override DTNode<L, T> add(L label); @Override long numLinks(); @Override Set<L> labels(); @Override boolean connected(L from, L to); @Override long state(); @SuppressWarnings("unchecked") @Override Class<? extends DTGraph<L, T>> level(); boolean equals(Object other); String toString(); static final int NEIGHBOR_CAPACITY; }### Answer:
@Test public void testToString() { DTGraph<String,String> graph = new LightDTGraph<String,String>(); DTNode<String,String> a = graph.add("a"), b = graph.add("b"); graph.add("c"); a.connect(b, "1"); System.out.println(graph); }