code: public TableFactor maxOut(int variable) {
      return marginalize(variable, Double.NEGATIVE_INFINITY, (marginalizedVariableValue, assignment) -> Math::max);
    }
docs: Marginalize out a variable by taking the max value.
  
  @param variable the variable to be maxed out.
  @return a table factor that will contain the largest value of the variable being marginalized out.