class EmptyLineRule extends TextLevelRule {

  private final Language lang;
  
  public EmptyLineRule(ResourceBundle messages, Language lang, boolean defaultActive) {
    super(messages);
    super.setCategory(Categories.STYLE.getCategory(messages));
    this.lang = lang;
    if (!defaultActive) {
      setDefaultOff();
    }
    setOfficeDefaultOn();  // Default for LO/OO is always On
    setLocQualityIssueType(ITSIssueType.Style);
  }

  public EmptyLineRule(ResourceBundle messages, Language lang) {
    this(messages, lang, false);
  }

  @Override
  public String getId() {
    return "EMPTY_LINE";
  }

  @Override
  public String getDescription() {
    return messages.getString("empty_line_rule_desc");
  }

  @Override
  public org.languagetool.rules.RuleMatch[] match(List<AnalyzedSentence> sentences) throws IOException {<FILL_FUNCTION_BODY>}

  private boolean isSecondParagraphEndMark(String sentence) {
    if (lang.getSentenceTokenizer().singleLineBreaksMarksPara()) {
      if (sentence.endsWith("\n\n") || sentence.endsWith("\n\r\n\r")) {
        return true;
      }
    } else { 
      if (sentence.endsWith("\n\n\n\n") || sentence.endsWith("\n\r\n\r\n\r\n\r") || sentence.endsWith("\r\n\r\n\r\n\r\n")) {
        return true;
      }
    }
    return false;
  }
  
  @Override
  public int minToCheckParagraph() {
    return 1;
  }

}

    List<RuleMatch> ruleMatches = new ArrayList<>();
    int pos = 0;
    for (int n = 0; n < sentences.size() - 1; n++) {
      AnalyzedSentence sentence = sentences.get(n);
      if(Tools.isParagraphEnd(sentences, n, lang)) {
        if(isSecondParagraphEndMark(sentence.getText())) {
          AnalyzedTokenReadings[] tokens = sentence.getTokensWithoutWhitespace();
          if(tokens.length > 1) {
            int fromPos = pos + tokens[tokens.length - 1].getStartPos();
            int toPos = pos + tokens[tokens.length - 1].getEndPos();
            RuleMatch ruleMatch = new RuleMatch(this, sentence, fromPos, toPos, messages.getString("empty_line_rule_msg"));
            // Can't use SuggestedReplacement because of problems in LO/OO dialog with linebreaks
            ruleMatches.add(ruleMatch);
          }
        }
      }
      pos += sentence.getCorrectedTextLength();
    }
    return toRuleMatchArray(ruleMatches);
  
<methods>public void <init>() ,public void <init>(java.util.ResourceBundle) ,public int estimateContextForSureMatch() ,public org.languagetool.rules.RuleMatch[] match(List<org.languagetool.AnalyzedSentence>, org.languagetool.markup.AnnotatedText) throws java.io.IOException,public abstract org.languagetool.rules.RuleMatch[] match(List<org.languagetool.AnalyzedSentence>) throws java.io.IOException,public final org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence) throws java.io.IOException,public abstract int minToCheckParagraph() <variables>