private static boolean isCompleteStatement(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);
  }
private static boolean isCompleteStatement(PsiExpressionStatement element)