InferenceVariable[] (PsiElement context, PsiTypeParameter @NotNull ... typeParameters) { if (typeParameters.length == 0) return new InferenceVariable[0]; Map<PsiTypeParameter, PsiType> map = myInferenceSubstitution.getSubstitutionMap(); InferenceVariable[] variables = StreamEx.of(typeParameters).map(map::get) .map(PsiUtil::resolveClassInClassTypeOnly) .select(InferenceVariable.class) .toArray(new InferenceVariable[0]); if (variables.length != 0) { if (variables.length != typeParameters.length) { LOG.error("Unexpected: either all vars or no vars should be present"); } return variables; } return initBounds(context, mySiteSubstitutor, typeParameters); }