class ValidWordFilter extends RuleFilter {

  @Nullable
  @Override
  public RuleMatch acceptRuleMatch(RuleMatch match, Map<String, String> arguments, int patternTokenPos, AnalyzedTokenReadings[] patternTokens, List<Integer> tokenPositions) throws IOException {<FILL_FUNCTION_BODY>}

}

    String word1 = arguments.get("word1") + arguments.get("word2");
    String word2 = arguments.get("word1") + arguments.get("word2").toLowerCase();
    GermanSpellerRule speller = GermanyGerman.INSTANCE.getDefaultSpellingRule();
    if (!speller.isMisspelled(word1) || !speller.isMisspelled(word2)) {
      // e.g. "(Promotions)Studierende" -> "Promotionsstudierende" is ok, so no match
      return null;
    }
    // all other cases, e.g.: "Das ist (vielleicht)der bessere Ansatz".
    return match;
  
<methods>public non-sealed void <init>() ,public abstract org.languagetool.rules.RuleMatch acceptRuleMatch(org.languagetool.rules.RuleMatch, Map<java.lang.String,java.lang.String>, int, org.languagetool.AnalyzedTokenReadings[], List<java.lang.Integer>) throws java.io.IOException,public boolean matches(Map<java.lang.String,java.lang.String>, org.languagetool.AnalyzedTokenReadings[], int, List<java.lang.Integer>) throws java.io.IOException<variables>