DirectedGraph { public boolean isConnected() throws DirectedGraphException { DirectedGraph<E, F> undirected = makeUndirectedCopy(); if (undirected == null) { return false; } return undirected.isStronglyConnected(); } DirectedGraph(); Vector<String> listEdges(); void addVertex(Vertex<E> v); void addEdge(Vertex<E> a, Vertex<E> b); void addEdge(Vertex<E> a, Vertex<E> b, F data); void addEdge(String aLabel, String bLabel); void addEdge(String aLabel, String bLabel, F data); F getEdgeData(Vertex<E> v1, Vertex<E> v2); Vector<F> getAllEdgeData(Vertex<E> v1, Vertex<E> v2); F getEdgeData(E vData1, E vData2); Vector<F> getAllEdgeData(E vData1, E vData2); boolean isStronglyConnected(); boolean isConnected(); Vector<Vertex<E>> getAdjacentVertices(final Vertex<E> v); void removeVertex(final Vertex<E> v); Vector<Vertex<E>> topoSort(final Vertex<E> v); Vector<Vertex<E>> topoSort(final String vLabel); Vertex<E> getVertexByLabel(final String vLabel); Vertex<E> getVertexByData(final E vData); Set<Vertex<E>> sources(); Set<Vertex<E>> from(final Vertex<E> v); Set<Vertex<E>> from(E vData); Set<Vertex<E>> to(Vertex<E> v); Set<Vertex<E>> to(E vData); Set<Vertex<E>> into(Vertex<E> v); Set<Vertex<E>> into(E vData); Vector<Vertex<E>> getTopoSort(); final Set<Vertex<E>> getVertices(); final Set<Edge<E, F>> getEdges();  }
@Test public void testIsConnected() throws DirectedGraphException { assertTrue(!disConnect.isStronglyConnected()); assertTrue(connect.isStronglyConnected()); }