class DecadeSpellingFilter extends RuleFilter {

  private static final int[]    numbers = { 1000,  900,  500,  400,  100,   90,
      50,   40,   10,    9,    5,    4,    1 };

  private static final String[] letters = { "M",  "CM",  "D",  "CD", "C",  "XC",
      "L",  "XL",  "X",  "IX", "V",  "IV", "I" };

  /**
   * Gets the Roman notation for numbers.
   * @param num the integer to convert
   * @return the String using the number.
   */
  private String getRomanNumber(int num) {
    StringBuilder roman = new StringBuilder();
    int n = num;    // n represents the part of num that still has to be converted to Roman numeral representation
    for (int i = 0; i < numbers.length; i++) {
      while (n >= numbers[i]) {
        roman.append(letters[i]);
        n -= numbers[i];
      }
    }
    return roman.toString();
  }

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

}

    try {
      String decade = arguments.get("lata").substring(2);
      String century = arguments.get("lata").substring(0, 2);
      int cent = Integer.parseInt(century);
      String message = match.getMessage()
          .replace("{dekada}", decade)
          .replace("{wiek}", getRomanNumber(cent + 1));
      RuleMatch ruleMatch = new RuleMatch(match.getRule(), match.getSentence(), match.getFromPos(), match.getToPos(), match.getPatternFromPos(), match.getPatternToPos(),
              message, match.getShortMessage(), match.getFromPos() == 0, null);
      ruleMatch.setType(match.getType());
      return ruleMatch;
    } catch (IllegalArgumentException ignore) {
      // ignore it silently
      return null;
    }
  
<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>