DirectedModel dm = new DirectedModel (vars);
dm.addFactor (pA);
dm.addFactor (pB);
dm.addFactor (pC);
BruteForceInferencer inf = new BruteForceInferencer ();
DiscreteFactor joint1 = (DiscreteFactor) inf.joint (fg1);
DiscreteFactor joint2 = (DiscreteFactor) inf.joint (dm);
comparePotentials (joint1, joint2);
}