class StdoutHandler extends ResultHandler {

  private final ContextTools contextTools = new ContextTools();
  private final boolean verbose;

  StdoutHandler(int maxSentences, int maxErrors) {
    this(maxSentences, maxErrors, CONTEXT_SIZE);
  }

  StdoutHandler(int maxSentences, int maxErrors, int contextSize) {
    this(maxSentences, maxErrors, contextSize, false);
  }

  StdoutHandler(int maxSentences, int maxErrors, int contextSize, boolean verbose) {
    super(maxSentences, maxErrors);
    contextTools.setContextSize(contextSize);
    this.verbose = verbose;
    //contextTools.setContextSize(100);
    //contextTools.setErrorMarker("**", "**");
    //contextTools.setEscapeHtml(false);
  }

  @Override
  protected void handleResult(Sentence sentence, List<RuleMatch> ruleMatches, Language language) {<FILL_FUNCTION_BODY>}

  @Override
  public void close() throws Exception {
  }
}

    if (ruleMatches.size() > 0) {
      int i = 1;
      System.out.println("\nTitle: " + sentence.getTitle());
      for (RuleMatch match : ruleMatches) {
        String output = i + ".) Line " + (match.getLine() + 1) + ", column "
                + match.getColumn() + ", Rule ID: " + match.getSpecificRuleId(); //match.getRule().getId();
        if (match.getRule() instanceof AbstractPatternRule) {
          AbstractPatternRule pRule = (AbstractPatternRule) match.getRule();
          output += "[" + pRule.getSubId() + "]";
        }
        if (match.getRule().isDefaultTempOff()) {
          output += " [temp_off]";
        }
        if (verbose && match.getRule() instanceof AbstractPatternRule) {
          AbstractPatternRule pRule = (AbstractPatternRule) match.getRule();
          output += " ruleLine=" + pRule.getXmlLineNumber();
        }
        System.out.println(output);
        String msg = match.getMessage();
        msg = msg.replaceAll("<suggestion>", "'");
        msg = msg.replaceAll("</suggestion>", "'");
        System.out.println("Message: " + msg);
        List<String> replacements = match.getSuggestedReplacements();
        if (!replacements.isEmpty()) {
          System.out.println("Suggestion: " + String.join("; ", replacements.subList(0, Math.min(replacements.size(), 5))));
        }
        if (match.getRule() instanceof AbstractPatternRule) {
          AbstractPatternRule pRule = (AbstractPatternRule) match.getRule();
          if (pRule.getSourceFile() != null) {
            System.out.println("Rule source: " + pRule.getSourceFile());
          }
        }
        System.out.println(contextTools.getPlainTextContext(match.getFromPos(), match.getToPos(), sentence.getText()));
        //System.out.println(contextTools.getContext(match.getFromPos(), match.getToPos(), sentence.getText()));
        i++;
        checkMaxErrors(++errorCount);
      }
    }
    checkMaxSentences(++sentenceCount);
  
<methods><variables>protected static final int CONTEXT_SIZE,protected static final java.lang.String MARKER_END,protected static final java.lang.String MARKER_START,protected int errorCount,private final non-sealed int maxErrors,private final non-sealed int maxSentences,protected int sentenceCount