docs: public FactorGraph conditional(Assignment assignment) {
      // Short-circuit when nothing is conditioned on.
      if (assignment.size() == 0) {
        return this;
      }
      LogFunction log = LogFunctions.getLogFunction();
      log.startTimer("conditional_assignment_stuff");
      Preconditions.checkArgument(variables.containsAll(assignment.getVariableNumsArray()));
  
      Assignment newConditionedValues = conditionedValues.union(assignment);
      VariableNumMap newConditionedVariables = conditionedVariables.union(
          variables.intersection(assignment.getVariableNumsArray()));
  
      VariableNumMap newVariables = variables.removeAll(assignment.getVariableNumsArray());
      log.stopTimer("conditional_assignment_stuff");
      // Condition each factor on assignment.
      int numFactors = factors.length;
      Factor[] newFactors = new Factor[numFactors];
      for (int i = 0; i < numFactors; i++) {
        newFactors[i] = factors[i].conditional(assignment);
      }
  
      return new FactorGraph(newVariables, newFactors, factorNames, newConditionedVariables,
          newConditionedValues, inferenceHint);
    }