// Path: parser/src/main/java/io/lindstrom/mpd/MPDParser.java
// public class MPDParser {
// 
//     private final ObjectMapper objectMapper;
// 
//     public MPDParser() {
//         this(defaultObjectMapper());
//     }
// 
//     public MPDParser(ObjectMapper objectMapper) {
//         this.objectMapper = objectMapper;
//     }
// 
//     public MPD parse(InputStream inputStream) throws IOException {
//         return objectMapper.readValue(inputStream, MPD.class);
//     }
// 
//     public MPD parse(String content) throws IOException {
//         return objectMapper.readValue(content, MPD.class);
//     }
// 
//     public String writeAsString(MPD mpd) throws JsonProcessingException {
//         return objectMapper.writeValueAsString(mpd);
//     }
// 
//     public byte[] writeAsBytes(MPD mpd) throws JsonProcessingException {
//         return objectMapper.writeValueAsBytes(mpd);
//     }
// 
//     public static ObjectMapper defaultObjectMapper() {
//         JacksonXmlModule module = new JacksonXmlModule();
//         module.setDefaultUseWrapper(false);
//         module.addSerializer(OffsetDateTime.class, new OffsetDateTimeSerializer())
//                 .addDeserializer(OffsetDateTime.class, new OffsetDateTimeDeserializer())
//                 .addSerializer(Duration.class, new DurationSerializer())
//                 .addDeserializer(Duration.class, new DurationDeserializer());
// 
//         return new XmlMapper(new XmlFactory(new WstxInputFactory(), new WstxPrefixedOutputFactory()), module)
//                 .enable(SerializationFeature.INDENT_OUTPUT)
//                 .setSerializationInclusion(JsonInclude.Include.NON_NULL)
//                 .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true)
//                 .configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE, true)
//                 .setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
//                 .setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.NONE);
//     }
// 
//     private static class WstxPrefixedOutputFactory extends WstxOutputFactory {
//         @Override
//         protected XMLStreamWriter2 createSW(String enc, WriterConfig cfg, XmlWriter xw) {
//             XMLStreamWriter2 streamWriter = super.createSW(enc, cfg, xw);
//             try {
//                 streamWriter.setPrefix("xsi", "http://www.w3.org/2001/XMLSchema-instance");
//                 streamWriter.setPrefix("xlink", "http://www.w3.org/1999/xlink");
//                 streamWriter.setPrefix("cenc", "urn:mpeg:cenc:2013");
//                 streamWriter.setPrefix("mspr", "urn:microsoft:playready");
//             } catch (Exception e) {
//                 throw new RuntimeException(e);
//             }
//             return streamWriter;
//         }
//     }
// }


import io.lindstrom.mpd.MPDParser;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.jupiter.api.Test;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
package io.lindstrom.mpd.data;




public class DataTypeTest {
    private static final String PACKAGE = DataTypeTest.class.getPackage().getName();

    @Test
    public void rebuildMPD() throws Exception {
// Path: parser/src/main/java/io/lindstrom/mpd/MPDParser.java
// public class MPDParser {
// 
//     private final ObjectMapper objectMapper;
// 
//     public MPDParser() {
//         this(defaultObjectMapper());
//     }
// 
//     public MPDParser(ObjectMapper objectMapper) {
//         this.objectMapper = objectMapper;
//     }
// 
//     public MPD parse(InputStream inputStream) throws IOException {
//         return objectMapper.readValue(inputStream, MPD.class);
//     }
// 
//     public MPD parse(String content) throws IOException {
//         return objectMapper.readValue(content, MPD.class);
//     }
// 
//     public String writeAsString(MPD mpd) throws JsonProcessingException {
//         return objectMapper.writeValueAsString(mpd);
//     }
// 
//     public byte[] writeAsBytes(MPD mpd) throws JsonProcessingException {
//         return objectMapper.writeValueAsBytes(mpd);
//     }
// 
//     public static ObjectMapper defaultObjectMapper() {
//         JacksonXmlModule module = new JacksonXmlModule();
//         module.setDefaultUseWrapper(false);
//         module.addSerializer(OffsetDateTime.class, new OffsetDateTimeSerializer())
//                 .addDeserializer(OffsetDateTime.class, new OffsetDateTimeDeserializer())
//                 .addSerializer(Duration.class, new DurationSerializer())
//                 .addDeserializer(Duration.class, new DurationDeserializer());
// 
//         return new XmlMapper(new XmlFactory(new WstxInputFactory(), new WstxPrefixedOutputFactory()), module)
//                 .enable(SerializationFeature.INDENT_OUTPUT)
//                 .setSerializationInclusion(JsonInclude.Include.NON_NULL)
//                 .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true)
//                 .configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE, true)
//                 .setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
//                 .setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.NONE);
//     }
// 
//     private static class WstxPrefixedOutputFactory extends WstxOutputFactory {
//         @Override
//         protected XMLStreamWriter2 createSW(String enc, WriterConfig cfg, XmlWriter xw) {
//             XMLStreamWriter2 streamWriter = super.createSW(enc, cfg, xw);
//             try {
//                 streamWriter.setPrefix("xsi", "http://www.w3.org/2001/XMLSchema-instance");
//                 streamWriter.setPrefix("xlink", "http://www.w3.org/1999/xlink");
//                 streamWriter.setPrefix("cenc", "urn:mpeg:cenc:2013");
//                 streamWriter.setPrefix("mspr", "urn:microsoft:playready");
//             } catch (Exception e) {
//                 throw new RuntimeException(e);
//             }
//             return streamWriter;
//         }
//     }
// }


// Path: parser/src/test/java/io/lindstrom/mpd/data/DataTypeTest.java
import io.lindstrom.mpd.MPDParser;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.junit.jupiter.api.Test;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;

package io.lindstrom.mpd.data;




public class DataTypeTest {
    private static final String PACKAGE = DataTypeTest.class.getPackage().getName();

    @Test
    public void rebuildMPD() throws Exception {
        MPD mpd = new MPDParser().parse(Files.newInputStream(Paths.get("src/test/resources/random.mpd")));