boolean (PsiExpression context) { final PsiElement methodCall = context.getParent(); if (!(methodCall instanceof PsiMethodCallExpression)) { return true; } final PsiElement expressionStatement = methodCall.getParent(); return !(expressionStatement instanceof PsiExpressionStatement); }