private boolean checkTextBlock(@NotNull PsiElement textBlock, @NotNull String suffix) {
        String text = textBlock.getText();
        String[] lines = text.split("\n", -1);
        int indent = getIndent(textBlock);
        if (indent == -1) return false;
        int offset = 0;
        for (int i = 0; i < lines.length; i++) {
          String line = lines[i];
          if (i != 0) offset++; // count newline
          if (line.startsWith("\"\"\"")) {
            offset += line.length();
            continue;
          }
          int lineEnd;
          if (line.endsWith(suffix)) {
            if (suffix.equals("\\{")) return false;
            lineEnd = line.length() - suffix.length();
          }
          else {
            lineEnd = line.length();
          }
          boolean fragmentStart = StringUtil.startsWithChar(line, '}');
          if (fragmentStart ? lineEnd != 0 : lineEnd > indent) {
            char c = line.charAt(lineEnd - 1);
            if (c == ' ' || c == '\t') {
              for (int j = lineEnd - 2; j >= 0; j--) {
                c = line.charAt(j);
                if (c != ' ' && c != '\t' || j < indent && !fragmentStart) {
                  holder.registerProblem(textBlock, new TextRange(offset + j + 1, offset + lineEnd),
                                         JavaBundle.message("inspection.trailing.whitespaces.in.text.block.message"),
                                         createFixes());
                  return true;
                }
              }
            }
          }
          offset += line.length();
        }
        return false;
      }
private boolean checkTextBlock(@NotNull PsiElement textBlock, @NotNull String suffix)