@Test
public void testIsAdjacent() {

    GraphStore graphStore = GraphGenerator.generateSmallGraphStore();
    GraphViewStore store = graphStore.viewStore;
    GraphViewImpl view = store.createView();
    addSomeElements(graphStore, view);
    DirectedSubgraph graph = store.getDirectedGraph(view);
    for (Edge e : graphStore.getEdges()) {
        if (graph.contains(e)) {
            Assert.assertTrue(graph.isAdjacent(e.getSource(), e.getTarget()));
        } else if (graph.contains(e.getSource()) && graph.contains(e.getTarget())) {
            Assert.assertFalse(graph.isAdjacent(e.getSource(), e.getTarget()));
        }
    }
    graph.clearEdges();
    Node[] nodes = graph.getNodes().toArray();
    Assert.assertFalse(graph.isAdjacent(nodes[0], nodes[1]));
}