// Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
//         use = JsonTypeInfo.Id.NAME,
//         property = "schemeIdUri",
//         include = JsonTypeInfo.As.EXISTING_PROPERTY,
//         visible = true,
//         defaultImpl = GenericDescriptor.class)
// @JsonSubTypes({
//         @JsonSubTypes.Type(value = Role.class, name = Role.SCHEME_ID_URI),
//         @JsonSubTypes.Type(value = Mp4Protection.class, name = Mp4Protection.SCHEME_ID_URI),
//         @JsonSubTypes.Type(value = PlayReadyContentProtection.class, name = PlayReadyContentProtection.SCHEME_ID_URI),
//         @JsonSubTypes.Type(value = WidewineProtection.class, name = WidewineProtection.SCHEME_ID_URI)
// })
// public abstract class Descriptor {
//     @JacksonXmlProperty(isAttribute = true)
//     protected final String schemeIdUri;
// 
//     @JacksonXmlProperty(isAttribute = true)
//     protected final String id;
// 
//     protected Descriptor(String schemeIdUri, String id) {
//         this.schemeIdUri = schemeIdUri;
//         this.id = id;
//     }
// 
//     public String getSchemeIdUri() {
//         return schemeIdUri;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     @JsonIgnore
//     public abstract String getValue();
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (!(o instanceof Descriptor)) return false;
//         Descriptor that = (Descriptor) o;
//         return Objects.equals(schemeIdUri, that.schemeIdUri) &&
//                 Objects.equals(id, that.id);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(schemeIdUri, id);
//     }
// }


import io.lindstrom.mpd.data.*;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
            ruleR33(adaptationSet),
            ruleR34(adaptationSet),
            ruleR35(adaptationSet),
            ruleR36(adaptationSet),
            ruleR37(adaptationSet),
            ruleR38(adaptationSet),
            ruleR39(adaptationSet),
            ruleRD30(adaptationSet, mpd),
            ruleRD31(adaptationSet, mpd),
            ruleRD32(adaptationSet, mpd),
            ruleRD33(adaptationSet, mpd),
            ruleRD34(adaptationSet, mpd),
            ruleRD35(adaptationSet, mpd),
            ruleRD36(adaptationSet, mpd),
            ruleRD37(adaptationSet, mpd),
            ruleRD38(adaptationSet),
            ruleR40(adaptationSet)));

        if (adaptationSet.getSegmentTemplate() != null) {
            violations.addAll(SegmentTemplateValidator.validate(mpd, adaptationSet.getSegmentTemplate()));
        }

        if (adaptationSet.getSegmentBase() != null) {
            violations.addAll(SegmentBaseValidator.validate(mpd, adaptationSet.getSegmentBase()));
        }

        if (adaptationSet.getSegmentList() != null) {
            violations.addAll(SegmentListValidator.validate(mpd, adaptationSet.getSegmentList()));
        }

// Path: parser/src/main/java/io/lindstrom/mpd/data/descriptor/Descriptor.java
// @JsonTypeInfo(
//         use = JsonTypeInfo.Id.NAME,
//         property = "schemeIdUri",
//         include = JsonTypeInfo.As.EXISTING_PROPERTY,
//         visible = true,
//         defaultImpl = GenericDescriptor.class)
// @JsonSubTypes({
//         @JsonSubTypes.Type(value = Role.class, name = Role.SCHEME_ID_URI),
//         @JsonSubTypes.Type(value = Mp4Protection.class, name = Mp4Protection.SCHEME_ID_URI),
//         @JsonSubTypes.Type(value = PlayReadyContentProtection.class, name = PlayReadyContentProtection.SCHEME_ID_URI),
//         @JsonSubTypes.Type(value = WidewineProtection.class, name = WidewineProtection.SCHEME_ID_URI)
// })
// public abstract class Descriptor {
//     @JacksonXmlProperty(isAttribute = true)
//     protected final String schemeIdUri;
// 
//     @JacksonXmlProperty(isAttribute = true)
//     protected final String id;
// 
//     protected Descriptor(String schemeIdUri, String id) {
//         this.schemeIdUri = schemeIdUri;
//         this.id = id;
//     }
// 
//     public String getSchemeIdUri() {
//         return schemeIdUri;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     @JsonIgnore
//     public abstract String getValue();
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (!(o instanceof Descriptor)) return false;
//         Descriptor that = (Descriptor) o;
//         return Objects.equals(schemeIdUri, that.schemeIdUri) &&
//                 Objects.equals(id, that.id);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(schemeIdUri, id);
//     }
// }


// Path: validator/src/main/java/io/lindstrom/mpd/validator/rules/AdaptationSetValidator.java
import io.lindstrom.mpd.data.*;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;

            ruleR33(adaptationSet),
            ruleR34(adaptationSet),
            ruleR35(adaptationSet),
            ruleR36(adaptationSet),
            ruleR37(adaptationSet),
            ruleR38(adaptationSet),
            ruleR39(adaptationSet),
            ruleRD30(adaptationSet, mpd),
            ruleRD31(adaptationSet, mpd),
            ruleRD32(adaptationSet, mpd),
            ruleRD33(adaptationSet, mpd),
            ruleRD34(adaptationSet, mpd),
            ruleRD35(adaptationSet, mpd),
            ruleRD36(adaptationSet, mpd),
            ruleRD37(adaptationSet, mpd),
            ruleRD38(adaptationSet),
            ruleR40(adaptationSet)));

        if (adaptationSet.getSegmentTemplate() != null) {
            violations.addAll(SegmentTemplateValidator.validate(mpd, adaptationSet.getSegmentTemplate()));
        }

        if (adaptationSet.getSegmentBase() != null) {
            violations.addAll(SegmentBaseValidator.validate(mpd, adaptationSet.getSegmentBase()));
        }

        if (adaptationSet.getSegmentList() != null) {
            violations.addAll(SegmentListValidator.validate(mpd, adaptationSet.getSegmentList()));
        }

        for (Descriptor framePacking : adaptationSet.getFramePackings()) {