boolean (PsiExpressionStatement element) { final PsiElement parent = element.getParent(); if (parent instanceof PsiForStatement && ((PsiForStatement)parent).getUpdate() == element) { return true; } PsiElement lastChild = element.getLastChild(); while (lastChild instanceof PsiComment || lastChild instanceof PsiWhiteSpace) { lastChild = lastChild.getPrevSibling(); } return PsiUtil.isJavaToken(lastChild, JavaTokenType.SEMICOLON); }