### Question:
LightDTGraph implements DTGraph<L, T> { @Override public boolean connected(L from, L to) { for(DTNode<L,T> a : nodes(from)) for(DTNode<L,T> b : nodes(to)) if(a.connected(b)) return true; return false; } 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 testConnected() { DTGraph<String,String> graph = new LightDTGraph<String,String>(); DTNode<String,String> a = graph.add(null), b = graph.add(null), c = graph.add(null); a.connect(b, null); a.connect(c, null); assertTrue(a.connected(b)); assertTrue(a.connectedTo(b)); assertFalse(a.connected(a)); assertFalse(a.connectedTo(a)); assertTrue(b.connected(a)); assertFalse(b.connectedTo(a)); assertTrue(a.connected(c)); assertTrue(a.connectedTo(c)); assertTrue(c.connected(a)); assertFalse(c.connectedTo(a)); assertFalse(b.connected(c)); assertFalse(b.connectedTo(c)); assertFalse(c.connected(b)); assertFalse(c.connectedTo(b)); }