@Test
public void testMoralize1() {

    Graph<BayesVariable> graph = new BayesNetwork();
    GraphNode x0 = addNode(graph);
    GraphNode x1 = addNode(graph);
    GraphNode x2 = addNode(graph);
    GraphNode x3 = addNode(graph);
    GraphNode x4 = addNode(graph);
    connectParentToChildren(x2, x1);
    connectParentToChildren(x3, x1);
    connectParentToChildren(x4, x1);
    JunctionTreeBuilder jtBuilder = new JunctionTreeBuilder( graph );
    assertLinkedNode(jtBuilder, new int[]{1, 2, 3, 4});
    assertLinkedNode(jtBuilder, new int[]{2, 1});
    assertLinkedNode(jtBuilder, new int[]{3, 1});
    assertLinkedNode(jtBuilder, new int[]{4, 1});
    jtBuilder.moralize();
    assertLinkedNode(jtBuilder, new int[]{1, 2, 3, 4});
    assertLinkedNode(jtBuilder, new int[]{2, 1, 3, 4});
    assertLinkedNode(jtBuilder, new int[]{3, 1, 2, 4});
    assertLinkedNode(jtBuilder, new int[]{4, 1, 2, 3});
}