private static boolean isTrailingComment(@NotNull PsiComment comment) {
    final PsiElement prevElement = comment.getPrevSibling();
    return prevElement != null && (!(prevElement instanceof PsiWhiteSpace) || !prevElement.textContains('\n'));
  }
private static boolean isTrailingComment(@NotNull PsiComment comment)