docs: public void maybeSetLegacyObjectMapOrRecordType() {
      if (type == Type.UNKNOWN) {
        type = Type.LEGACY_OBJECT_MAP_OR_RECORD;
      } else if (type == Type.MAP) {
        throw new IllegalStateException(
            "Expected a value of type `legacy_object_map`, got `map`. "
                + "These two map types are not interoperable. "
                + "Use `mapToLegacyObjectMap()` to convert this object to a legacy_object_map.");
      }
    }