boolean (@NotNull PsiType rootType, @NotNull PsiTypeParameter parameter, @NotNull PsiSubstitutor superClassSubstitutor, boolean ignoreWildcardT) { return rootType.accept(new PsiTypeVisitor<>() { @NotNull @Override public Boolean visitClassType(@NotNull PsiClassType classType) { for (PsiType param : classType.getParameters()) { if (param.accept(this)) return true; } return visitType(classType); } @NotNull @Override public Boolean visitArrayType(@NotNull PsiArrayType arrayType) { return arrayType.getComponentType().accept(this); } @NotNull @Override public Boolean visitWildcardType(@NotNull PsiWildcardType wildcardType) { PsiType bound = wildcardType.getBound(); if (bound == null) { return false; } if (ignoreWildcardT && typeResolvesTo(bound, parameter, superClassSubstitutor)) return false; return bound.accept(this); } @NotNull @Override public Boolean visitType(@NotNull PsiType type) { return typeResolvesTo(type, parameter, superClassSubstitutor); } }); }