private static HighlightInfo.Builder checkTypeParameterWithinItsBound(@NotNull PsiTypeParameter classParameter,
                                                                @NotNull PsiSubstitutor substitutor,
                                                                @NotNull PsiType type,
                                                                @NotNull PsiElement typeElement2Highlight,
                                                                @Nullable PsiReferenceParameterList referenceParameterList) {
    PsiClass referenceClass = type instanceof PsiClassType ? ((PsiClassType)type).resolve() : null;
    PsiType psiType = substitutor.substitute(classParameter);
    if (psiType instanceof PsiClassType && !(PsiUtil.resolveClassInType(psiType) instanceof PsiTypeParameter)) {
      if (GenericsUtil.checkNotInBounds(type, psiType, referenceParameterList)) {
        String description = JavaErrorBundle.message("actual.type.argument.contradict.inferred.type");
        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(typeElement2Highlight).descriptionAndTooltip(description);
      }
    }

    PsiClassType[] bounds = classParameter.getSuperTypes();
    for (PsiType bound : bounds) {
      bound = substitutor.substitute(bound);
      if (!bound.equalsToText(CommonClassNames.JAVA_LANG_OBJECT) && GenericsUtil.checkNotInBounds(type, bound, referenceParameterList)) {
        PsiClass boundClass = bound instanceof PsiClassType ? ((PsiClassType)bound).resolve() : null;

        boolean extend = boundClass == null ||
                         referenceClass == null ||
                         referenceClass.isInterface() == boundClass.isInterface() ||
                         referenceClass instanceof PsiTypeParameter;
        String description = JavaErrorBundle.message(extend
                                                     ? "generics.type.parameter.is.not.within.its.bound.extend"
                                                     : "generics.type.parameter.is.not.within.its.bound.implement",
                                                     referenceClass != null
                                                     ? HighlightUtil.formatClass(referenceClass)
                                                     : type.getPresentableText(),
                                                     JavaHighlightUtil.formatType(bound));

        HighlightInfo.Builder builder =
          HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(typeElement2Highlight).descriptionAndTooltip(description);
        if (bound instanceof PsiClassType && referenceClass != null) {
          IntentionAction fix = QuickFixFactory.getInstance().createExtendsListFix(referenceClass, (PsiClassType)bound, true);
          builder.registerFix(fix, null, HighlightDisplayKey.getDisplayNameByKey(null), null, null);
        }
        return builder;
      }
    }
    return null;
  }
private static HighlightInfo.Builder checkTypeParameterWithinItsBound(@NotNull PsiTypeParameter classParameter,
                                                                @NotNull PsiSubstitutor substitutor,
                                                                @NotNull PsiType type,
                                                                @NotNull PsiElement typeElement2Highlight,
                                                                @Nullable PsiReferenceParameterList referenceParameterList)