PsiExpression (PsiExpression expression, PsiElement parent) { final PsiElement parParent = parent.getParent(); if (parParent instanceof PsiTypeCastExpression) { final PsiTypeElement typeElement = ((PsiTypeCastExpression)parParent).getCastType(); if (typeElement != null) { final PsiType type = typeElement.getType(); final PsiClass aClass = PsiTypesUtil.getPsiClass(type); if (aClass != null && GuavaLambda.PREDICATE.getClassQName().equals(aClass.getQualifiedName())) { expression = (PsiExpression)parParent.replace(expression); } } } return expression; }