void (PsiElement declarationStatement, PsiElement element, PsiElement unchanged) { final Collection<PsiComment> comments = PsiTreeUtil.findChildrenOfType(declarationStatement, PsiComment.class); final PsiElement parent = element.getParent(); for (PsiComment comment : comments) { if (PsiTreeUtil.isAncestor(unchanged, comment, false)) { continue; } parent.addBefore(comment, element); } }