Object2IntMap<PsiTypeVariable> () { Object2IntMap<PsiTypeVariable> result=new Object2IntOpenHashMap<>(); for (Constraint constr : myConstraints) { PsiTypeVarCollector collector = new PsiTypeVarCollector(); setDegree(collector.getSet(constr.getRight()), result); } return result; }