code: public MaxSAT.MaxSATResult solve(final MaxSATHandler handler) {
      if (this.result != UNDEF)
        return this.result;
      if (this.solver.currentWeight() == 1)
        this.solver.setProblemType(MaxSAT.ProblemType.UNWEIGHTED);
      else
        this.solver.setProblemType(MaxSAT.ProblemType.WEIGHTED);
      this.result = this.solver.search(handler);
      return this.result;
    }
docs: Solves the formula on the solver and returns the result.
  @param handler a MaxSAT handler
  @return the result (SAT, UNSAT, Optimum found, or UNDEF if canceled by the handler)