void (PsiType expectedTypeByParent, PsiCall callWithSingleCast, Runnable registerIntentions) { JavaResolveResult resolveResult = callWithSingleCast.resolveMethodGenerics(); if (resolveResult.getElement() != null && resolveResult.isValidResult()) { if (expectedTypeByParent != null && callWithSingleCast instanceof PsiCallExpression) { PsiType type = ((PsiCallExpression)callWithSingleCast).getType(); if (type != null && !TypeConversionUtil.isAssignable(expectedTypeByParent, type)) return; } registerIntentions.run(); } }