boolean (PsiStatement statement, @NotNull String methodName) { if (statement == null) { return false; } if (!(statement instanceof PsiExpressionStatement expressionStatement)) { return false; } final PsiExpression expression = expressionStatement.getExpression(); if (!(expression instanceof PsiMethodCallExpression methodCallExpression)) { return false; } final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); final String referenceName = methodExpression.getReferenceName(); if (!methodName.equals(referenceName)) { return false; } final PsiExpression qualifier = methodExpression.getQualifierExpression(); return TypeUtils.expressionHasTypeOrSubtype(qualifier, loggerClassName); }