@NotNull
  public static Collector<Ref<PyType>, ?, Ref<PyType>> toUnionFromRef() {
    return Collectors.reducing(null, (accType, hintType) -> {
      if (hintType == null) {
        return accType;
      }
      else if (accType == null) {
        return hintType;
      }
      else {
        return Ref.create(PyUnionType.union(accType.get(), hintType.get()));
      }
    });
  }
@NotNull
  public static Collector<Ref<PyType>, ?, Ref<PyType>> toUnionFromRef()