@Test
public void testMapNodeToCliques() {

    Graph<BayesVariable> graph = new BayesNetwork();
    JunctionTreeBuilder tbuilder = new JunctionTreeBuilder(graph);
    GraphNode x0 = addNode(graph);
    GraphNode x1 = addNode(graph);
    GraphNode x2 = addNode(graph);
    GraphNode x3 = addNode(graph);
    GraphNode x4 = addNode(graph);
    GraphNode x5 = addNode(graph);
    GraphNode x6 = addNode(graph);
    GraphNode x7 = addNode(graph);
    OpenBitSet clique0 = bitSet("01010101");
    OpenBitSet clique1 = bitSet("10010001");
    OpenBitSet clique2 = bitSet("10111010");
    OpenBitSet[] nodeToCliques = new OpenBitSet[8];
    tbuilder.mapVarNodeToCliques(nodeToCliques, 0, clique0);
    tbuilder.mapVarNodeToCliques(nodeToCliques, 1, clique1);
    tbuilder.mapVarNodeToCliques(nodeToCliques, 2, clique2);
    assertEquals( bitSet("011"), nodeToCliques[0] );
    assertEquals( bitSet("100"), nodeToCliques[1] );
    assertEquals( bitSet("001"), nodeToCliques[2] );
    assertEquals( bitSet("100"), nodeToCliques[3] );
    assertEquals( bitSet("111"), nodeToCliques[4] );
    assertEquals( bitSet("100"), nodeToCliques[5] );
    assertEquals( bitSet("001"), nodeToCliques[6] );
    assertEquals( bitSet("110"), nodeToCliques[7] );
}