GraphStore implements DirectedGraph, DirectedSubgraph { @Override public boolean isAdjacent(final Node node1, final Node node2) { autoReadLock(); try { return edgeStore.isAdjacent(node1, node2); } finally { autoReadUnlock(); } } GraphStore();  GraphStore(GraphModelImpl model); @Override boolean addNode(final Node node); @Override boolean addAllNodes(final Collection<? extends Node> nodes); @Override boolean addEdge(final Edge edge); @Override boolean addAllEdges(Collection<? extends Edge> edges); @Override NodeImpl getNode(final Object id); @Override boolean hasNode(final Object id); @Override EdgeImpl getEdge(final Object id); @Override boolean hasEdge(final Object id); @Override Edge getMutualEdge(Edge edge); @Override NodeIterable getNodes(); @Override EdgeIterable getEdges(); @Override EdgeIterable getSelfLoops(); @Override boolean removeNode(final Node node); @Override boolean removeEdge(final Edge edge); @Override boolean removeAllNodes(Collection<? extends Node> nodes); @Override boolean removeAllEdges(Collection<? extends Edge> edges); NodeStore getNodeStore(); EdgeStore getEdgeStore(); @Override boolean contains(final Node node); @Override boolean contains(final Edge edge); @Override Edge getEdge(final Node node1, final Node node2, final int type); @Override EdgeIterable getEdges(Node node1, Node node2, int type); @Override Edge getEdge(final Node node1, final Node node2); @Override EdgeIterable getEdges(Node node1, Node node2); @Override NodeIterable getNeighbors(final Node node); @Override NodeIterable getNeighbors(final Node node, final int type); @Override NodeIterable getPredecessors(final Node node); @Override NodeIterable getPredecessors(final Node node, final int type); @Override NodeIterable getSuccessors(final Node node); @Override NodeIterable getSuccessors(final Node node, final int type); @Override EdgeIterable getEdges(final Node node); @Override EdgeIterable getEdges(final Node node, final int type); @Override EdgeIterable getInEdges(final Node node); @Override EdgeIterable getInEdges(final Node node, final int type); @Override EdgeIterable getOutEdges(final Node node); @Override EdgeIterable getOutEdges(final Node node, final int type); @Override int getNodeCount(); @Override int getEdgeCount(); @Override int getEdgeCount(final int type); @Override Node getOpposite(final Node node, final Edge edge); @Override int getDegree(final Node node); int getUndirectedDegree(final Node node); @Override int getInDegree(final Node node); @Override int getOutDegree(final Node node); @Override boolean isSelfLoop(final Edge edge); @Override boolean isDirected(final Edge edge); @Override boolean isAdjacent(final Node node1, final Node node2); @Override boolean isAdjacent(final Node node1, final Node node2, final int type); @Override boolean isIncident(final Edge edge1, final Edge edge2); @Override boolean isIncident(final Node node, final Edge edge); @Override void clearEdges(final Node node); @Override void clearEdges(final Node node, final int type); @Override void clear(); @Override void clearEdges(); @Override GraphView getView(); @Override Object getAttribute(String key); @Override Object getAttribute(String key, double timestamp); @Override Object getAttribute(String key, Interval interval); @Override Set<String> getAttributeKeys(); @Override void setAttribute(String key, Object value); @Override void removeAttribute(String key); @Override void setAttribute(String key, Object value, double timestamp); @Override void setAttribute(String key, Object value, Interval interval); @Override void removeAttribute(String key, double timestamp); @Override void removeAttribute(String key, Interval interval); @Override void readLock(); @Override void readUnlock(); @Override void readUnlockAll(); @Override void writeLock(); @Override void writeUnlock(); @Override GraphModel getModel(); @Override boolean isDirected(); @Override boolean isUndirected(); @Override boolean isMixed(); @Override void union(Subgraph subGraph); @Override void intersection(Subgraph subGraph); @Override void fill(); @Override void not(); @Override Graph getRootGraph(); int deepHashCode(); boolean deepEquals(GraphStore obj);  }
@Test public void testIsAdjacent() { GraphStore graphStore = GraphGenerator.generateTinyGraphStore(); Node n1 = graphStore.getNode("1"); Node n2 = graphStore.getNode("2"); Assert.assertTrue(graphStore.isAdjacent(n1, n2)); Assert.assertFalse(graphStore.isAdjacent(n2, n1)); graphStore.clearEdges(); Assert.assertFalse(graphStore.isAdjacent(n1, n2)); }