@Test
public void testCreateClique() {

    Graph<BayesVariable> graph = new BayesNetwork();
    GraphNode dX0 = addNode(graph);
    GraphNode dX1 = addNode(graph);
    GraphNode dX2 = addNode(graph);
    GraphNode dX3 = addNode(graph);
    GraphNode dX4 = addNode(graph);
    GraphNode dX5 = addNode(graph);
    connectParentToChildren(dX1, dX2, dX3, dX4);
    JunctionTreeBuilder jtBuilder = new JunctionTreeBuilder( graph );
    // do not moralize, as we want to test just the clique creation through elimination of the provided vertices
    Set<Integer> vertices = new HashSet<Integer>();
    boolean[] adjList = new boolean[] { false, false, true, true, true, false };
    boolean[][] clonedAdjMatrix = JunctionTreeBuilder.cloneAdjacencyMarix(jtBuilder.getAdjacencyMatrix());
    jtBuilder.createClique(dX1.getId(), clonedAdjMatrix, vertices, adjList );
    assertEquals( 3, vertices.size() );
    assertTrue( vertices.containsAll(Arrays.asList(new Integer[]{2, 3, 4})) );
    assertLinkedNode(jtBuilder, 1, 2, 3, 4);
    assertLinkedNode(jtBuilder, 2, 1, 3, 4);
    assertLinkedNode(jtBuilder, 3, 1, 2, 4);
    assertLinkedNode(jtBuilder, 4, 1, 2, 3);
}