PsiType (PsiType type) { if (type instanceof PsiWildcardType wildcardType && wildcardType.isExtends()) { return wildcardType.getBound(); } if (type instanceof PsiCapturedWildcardType capturedWildcardType) { return capturedWildcardType.getUpperBound(); } return type; }