private static boolean isCastRequired(@NotNull VariableData data, @NotNull PsiExpression val) {
    final PsiType exprType = val.getType();
    if (exprType == null || TypeConversionUtil.isAssignable(data.type, exprType)) {
      return false;
    }
    final PsiClass psiClass = PsiUtil.resolveClassInClassTypeOnly(data.type);
    return !(psiClass instanceof PsiTypeParameter);
  }
private static boolean isCastRequired(@NotNull VariableData data, @NotNull PsiExpression val)