void (List<Pair<PsiParameter, PsiType>> expectedParams) { List<TypeConstraint> constraints = new ArrayList<>(); for (Pair<PsiParameter, PsiType> pair : expectedParams) { final PsiType type = pair.second; if (type != null) { constraints.add(SubtypeConstraint.create(type)); if (type instanceof PsiArrayType && pair.first.isVarArgs()) { constraints.add(SubtypeConstraint.create(((PsiArrayType)type).getComponentType())); } } } if (!constraints.isEmpty()) { myResult = constraints.toArray(TypeConstraint.EMPTY_ARRAY); } }