private static void doCheckNewCall(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();
    }
  }
private static void doCheckNewCall(PsiType expectedTypeByParent, PsiCall callWithSingleCast, Runnable registerIntentions)