List<PsiElement> (@NotNull PsiElement element) { if (!(element instanceof PsiStatement)) { return Collections.emptyList(); } List<PsiElement> suffix = new ArrayList<>(); PsiElement lastChild = element.getLastChild(); boolean hasComment = false; while (lastChild instanceof PsiComment || lastChild instanceof PsiWhiteSpace) { hasComment |= lastChild instanceof PsiComment; if (!(lastChild instanceof PsiComment) || !shouldIgnore((PsiComment)lastChild)) { suffix.add(markUnchanged(lastChild).copy()); } lastChild = lastChild.getPrevSibling(); } return hasComment ? suffix : Collections.emptyList(); }