public static @Nullable LegacyJsonSchemaObjectMerger.ExclusionAndTypeInfo computeMergedExclusionAndType(@Nullable JsonSchemaType selfType,
                                                                                                          @Nullable JsonSchemaType otherType,
                                                                                                          @Nullable Set<JsonSchemaType> otherTypeVariants) {
    if (selfType == null) return new ExclusionAndTypeInfo(null, otherType);
    if (otherType == null) {
      if (otherTypeVariants != null && !otherTypeVariants.isEmpty()) {
        Set<JsonSchemaType> filteredVariants = EnumSet.noneOf(JsonSchemaType.class);
        for (JsonSchemaType variant : otherTypeVariants) {
          ProgressManager.checkCanceled();
          JsonSchemaType subtype = getSubtypeOfBoth(selfType, variant);
          if (subtype != null) filteredVariants.add(subtype);
        }
        if (filteredVariants.isEmpty()) {
          return new ExclusionAndTypeInfo(false, selfType);
        }
        if (filteredVariants.size() == 1) {
          return new ExclusionAndTypeInfo(null, filteredVariants.iterator().next());
        }
        return null; // will be handled by variants
      }
      return new ExclusionAndTypeInfo(null, selfType);
    }

    JsonSchemaType subtypeOfBoth = getSubtypeOfBoth(selfType, otherType);
    if (subtypeOfBoth == null) {
      return new ExclusionAndTypeInfo(false, otherType);
    }
    return new ExclusionAndTypeInfo(null, subtypeOfBoth);
  }
public static @Nullable LegacyJsonSchemaObjectMerger.ExclusionAndTypeInfo computeMergedExclusionAndType(@Nullable JsonSchemaType selfType,
                                                                                                          @Nullable JsonSchemaType otherType,
                                                                                                          @Nullable Set<JsonSchemaType> otherTypeVariants)