boolean (@NotNull PsiStatement statement, boolean testForSuper, boolean testForThis) { if (!(statement instanceof PsiExpressionStatement)) return false; PsiExpression expression = ((PsiExpressionStatement)statement).getExpression(); if (!(expression instanceof PsiMethodCallExpression)) return false; PsiReferenceExpression methodExpression = ((PsiMethodCallExpression)expression).getMethodExpression(); if (testForSuper) { if ("super".equals(methodExpression.getText())) return true; } return testForThis && "this".equals(methodExpression.getText()); }