Binding (final PsiType x, final PsiType y, final Set<? super Constraint> constraints) { final Binding binding = balance(x, y, new Balancer() { @Override public Binding varType(final PsiTypeVariable x, final PsiType y) { if (y instanceof Bottom || y instanceof PsiWildcardType) { return create(); } return create(x, y); } @Override public Binding varVar(final PsiTypeVariable x, final PsiTypeVariable y) { final int xi = x.getIndex(); final int yi = y.getIndex(); if (xi < yi) { return create(x, y); } else if (yi < xi) { return create(y, x); } else { return create(); } } @Override public Binding typeVar(final PsiType x, final PsiTypeVariable y) { if (x == null) return create(y, Bottom.BOTTOM); if (x instanceof PsiWildcardType) return create(); return create(y, x); } }, constraints); return binding != null ? binding.reduceRecursive() : null; }