private static BiFunction<Character, Integer, String> rangeOf(int from, int to) {
    return (letter, count) -> {
      if (count < from) return InspectionGadgetsBundle.message("inspection.incorrect.date.format.too.few.letters", letter, from, count);
      if (count > to) return InspectionGadgetsBundle.message("inspection.incorrect.date.format.too.many.letters", letter, to, count);
      return null;
    };
  }
private static BiFunction<Character, Integer, String> rangeOf(int from, int to)