@NotNull
  private static Pair<List<PsiComment>, PsiElement> getPrecedingCommentsAndAnchor(PsiElement element, boolean stopAtBlankLine,
                                                                                  boolean strict) {
    final ArrayList<PsiComment> result = new ArrayList<>();
    PsiElement cursor = element instanceof PsiComment && !strict ? element : element.getPrevSibling();
    while (true) {
      int newLinesCount = 0;
      while (cursor instanceof PsiWhiteSpace) {
        newLinesCount += StringUtil.getLineBreakCount(cursor.getText());
        cursor = cursor.getPrevSibling();
      }
      if ((stopAtBlankLine && newLinesCount > 1) || !(cursor instanceof PsiComment)) {
        break;
      }
      else {
        result.add((PsiComment)cursor);
      }
      cursor = cursor.getPrevSibling();
    }
    Collections.reverse(result);
    return Pair.create(result, cursor);
  }
@NotNull
  private static Pair<List<PsiComment>, PsiElement> getPrecedingCommentsAndAnchor(PsiElement element, boolean stopAtBlankLine,
                                                                                  boolean strict)