class SentenceWhitespaceRule extends TextLevelRule {

  public SentenceWhitespaceRule(ResourceBundle messages) {
    super(messages);
    super.setCategory(Categories.TYPOGRAPHY.getCategory(messages));
    setLocQualityIssueType(ITSIssueType.Whitespace);
  }
  
  @Override
  public String getId() {
    return "SENTENCE_WHITESPACE";
  }

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

  public String getMessage(boolean prevSentenceEndsWithNumber) {
    return messages.getString("addSpaceBetweenSentences");
  }

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

  @Override
  public int minToCheckParagraph() {
    return 0;
  }
  
}

    boolean isFirstSentence = true;
    boolean prevSentenceEndsWithWhitespace = false;
    boolean prevSentenceEndsWithNumber = false;
    List<RuleMatch> ruleMatches = new ArrayList<>();
    int pos = 0;
    for (AnalyzedSentence sentence : sentences) {
      AnalyzedTokenReadings[] tokens = sentence.getTokens();
      if (isFirstSentence) {
        isFirstSentence = false;
      } else {
        if (!prevSentenceEndsWithWhitespace && tokens.length > 1) {
          String firstToken = tokens[1].getToken();
          RuleMatch ruleMatch = new RuleMatch(this, sentence, pos, pos+firstToken.length(), getMessage(prevSentenceEndsWithNumber));
          ruleMatch.setSuggestedReplacement(" " + firstToken);
          ruleMatches.add(ruleMatch);
        }
      }
      if (tokens.length > 0) {
        String lastToken = tokens[tokens.length-1].getToken();
        prevSentenceEndsWithWhitespace = lastToken.replace('\u00A0',' ').trim().isEmpty() && lastToken.length() == 1;
      }
      if (tokens.length > 1) {
        String prevLastToken = tokens[tokens.length-2].getToken();
        prevSentenceEndsWithNumber = StringUtils.isNumeric(prevLastToken);
      }
      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>