boolean (PsiMethodReferenceExpression expression) { final PsiElement referenceNameElement = expression.getReferenceNameElement(); if (referenceNameElement instanceof PsiKeyword) { final PsiElement qualifier = expression.getQualifier(); if (qualifier instanceof PsiTypeElement) { return true; } if (qualifier instanceof PsiReferenceExpression && ((PsiReferenceExpression)qualifier).resolve() instanceof PsiClass) { return true; } } return false; }