PsiExpression (PsiExpression expression) { final PsiType type = expression.getType(); if (type instanceof PsiClassType) { final PsiClass resolvedClass = ((PsiClassType)type).resolve(); if (resolvedClass != null && CommonClassNames.JAVA_LANG_CLASS.equals(resolvedClass.getQualifiedName())) { return JavaPsiFacade.getElementFactory(expression.getProject()) .createExpressionFromText("(" + expression.getText() + ")::isInstance", null); } } return expression; }