public static void updateCliques(List<OpenBitSet> cliques, OpenBitSet newClique) {
        // iterate all the existing cliques, checking for a superset.
        // if no superset is found, then add the cliques
        boolean superSetFound = false;
        for ( OpenBitSet existingCluster : cliques ) {
            // is existingCluster a supserset of newClique, visa-vis is newClique a subset of  existingCluster
            if ( OpenBitSet.andNotCount(newClique, existingCluster) == 0) {
                superSetFound = true;
                break; // superset found
            }
        }
        if ( !superSetFound ) {
            cliques.add(newClique);
        }
    }
@Test
    public void testCliqueSuperSet() {
        Graph<BayesVariable> graph = new BayesNetwork();
        JunctionTreeBuilder jtBuilder = new JunctionTreeBuilder( graph );

        List<OpenBitSet> cliques = new ArrayList<OpenBitSet>();
        OpenBitSet OpenBitSet1 = bitSet("00011110");
        jtBuilder.updateCliques(cliques, OpenBitSet1);
        assertThat(cliques.size()).isEqualTo(1);

        // ignore subset
        OpenBitSet OpenBitSet2 = bitSet("00000110");
        jtBuilder.updateCliques(cliques, OpenBitSet2);
        assertThat(cliques.size()).isEqualTo(1);
        assertThat(cliques.get(0)).isEqualTo(OpenBitSet1);

        // add overlapping, as not a pure subset
        OpenBitSet OpenBitSet3 = bitSet("01000110");
        jtBuilder.updateCliques(cliques, OpenBitSet3);
        assertThat(cliques.size()).isEqualTo(2);
        assertThat(cliques.get(0)).isEqualTo(OpenBitSet1);
        assertThat(cliques.get(1)).isEqualTo(OpenBitSet3);
    }