docs: private Assignment getBestAssignment(Assignment portion, CliqueTree cliqueTree, int initialFactor) {
      if (cliqueTree.getMarginals().size() == 0) {
        // Special case where the factor graph has no factors in it.
        return conditionedValues;
      } else {
        // General case
        SortedSet<Integer> unvisited = Sets.newTreeSet();
        for (int i = 0; i < cliqueTree.numFactors(); i++) {
          unvisited.add(i);
        }
  
        Set<Integer> visited = Sets.newHashSet();
        Assignment current = portion;
        int nextFactor = initialFactor;
        while (unvisited.size() > 0) {
          current = getBestAssignmentGiven(cliqueTree, nextFactor, visited, current);
          unvisited.removeAll(visited);
          if (unvisited.size() > 0) {
            nextFactor = unvisited.first();
          }
        }
  
        return current.union(conditionedValues);
      }
    }