@Override
    public @Nullable TypeConstraint tryJoinExactly(TypeConstraint other) {
      if (isSuperConstraintOf(other)) return this;
      if (other.isSuperConstraintOf(this)) return other;
      if (other instanceof Constrained constrained) {
        if (myInstanceOf.equals(constrained.myInstanceOf)) {
          return joinWithConstrained(constrained);
        }
        int size1 = myInstanceOf.size() + myNotInstanceOf.size();
        int size2 = constrained.myInstanceOf.size() + constrained.myNotInstanceOf.size();
        // size1 >= 3 check allows to avoid merging too eagerly and preserves 'possible CCE' warnings
        if (size1 == size2 && size1 >= 3) {
          if (myInstanceOf.containsAll(constrained.myInstanceOf) &&
              constrained.myNotInstanceOf.containsAll(myNotInstanceOf)) {
            Set<Exact> diff = new HashSet<>(myInstanceOf);
            diff.removeAll(constrained.myInstanceOf);
            if (diff.size() == 1 && constrained.myNotInstanceOf.containsAll(diff)) {
              return new Constrained(constrained.myInstanceOf, myNotInstanceOf);
            }
          }
          if (constrained.myInstanceOf.containsAll(myInstanceOf) &&
              myNotInstanceOf.containsAll(constrained.myNotInstanceOf)) {
            Set<Exact> diff = new HashSet<>(constrained.myInstanceOf);
            diff.removeAll(myInstanceOf);
            if (diff.size() == 1 && myNotInstanceOf.containsAll(diff)) {
              return new Constrained(myInstanceOf, constrained.myNotInstanceOf);
            }
          }
        }
      }
      return null;
    }
@Override
    public @Nullable TypeConstraint tryJoinExactly(TypeConstraint other)