docs: private Assignment doSample(FactorGraph factorGraph, Assignment curAssignment, int varNum) {
  		// Retain the assignments to all other variables.
  		Assignment otherVarAssignment = curAssignment.removeAll(varNum);
  
  		// Multiply together all of the factors which define a probability distribution over 
  		// variable varNum, conditioned on all other variables.
  		Set<Integer> factorNums = factorGraph.getFactorsWithVariable(varNum);
  
  		Preconditions.checkState(factorNums.size() > 0, "Variable not in factor: " + varNum + " " + factorNums);
  		List<Factor> factorsToCombine = new ArrayList<Factor>();
  		for (Integer factorNum : factorNums) {
  			Factor conditional = factorGraph.getFactor(factorNum)
  				.conditional(otherVarAssignment);
  			factorsToCombine.add(conditional.marginalize(otherVarAssignment.getVariableNums()));
  		}
  		Factor toSampleFrom = factorsToCombine.get(0).product(factorsToCombine.subList(1, factorsToCombine.size()));
  		// Draw the sample and update the sampler's current assignment. 
  		Assignment subsetValues = toSampleFrom.sample();
  		
  		return otherVarAssignment.union(subsetValues);
  	}