// Path: src/main/java/com/_4dconcept/springframework/data/marklogic/core/mapping/MarklogicMappingContext.java
// public class MarklogicMappingContext extends AbstractMappingContext<BasicMarklogicPersistentEntity<?>, MarklogicPersistentProperty> {
// 
//     @Override
//     protected <T> BasicMarklogicPersistentEntity<T> createPersistentEntity(TypeInformation<T> typeInformation) {
//         return new BasicMarklogicPersistentEntity<>(typeInformation);
//     }
// 
//     @Override
//     protected MarklogicPersistentProperty createPersistentProperty(Property property,
//             BasicMarklogicPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) {
//         return new BasicMarklogicPersistentProperty(property, owner, simpleTypeHolder);
//     }
// }


import static org.hamcrest.MatcherAssert.assertThat;
import com._4dconcept.springframework.data.marklogic.core.mapping.Collection;
import com._4dconcept.springframework.data.marklogic.core.mapping.Document;
import com._4dconcept.springframework.data.marklogic.core.mapping.MarklogicMappingContext;
import org.hamcrest.CoreMatchers;
import org.junit.Test;
import org.springframework.core.convert.ConverterNotFoundException;
import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.converter.ConditionalGenericConverter;
import org.springframework.core.convert.converter.GenericConverter;
import org.springframework.lang.Nullable;
import java.util.Arrays;
import java.util.Collections;
import java.util.Set;
        public Set<ConvertiblePair> getConvertibleTypes() {
            return Collections.singleton(new ConvertiblePair(ConvertibleObject.class, String.class));
        }

        @Override
        public Object convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
            return "<empty />";
        }

    }

    static class DocumentConverter implements ConditionalGenericConverter {
        @Override
        public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
            return sourceType.getObjectType().isAnnotationPresent(Document.class);
        }

        @Override
        public Set<ConvertiblePair> getConvertibleTypes() {
            return Collections.singleton(new ConvertiblePair(Object.class, String.class));
        }

        @Override
        public Object convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
            return "<person><id>1</id></person>";
        }

    }

    private MappingMarklogicConverter createConverterWithDelegates(GenericConverter... converters) {
// Path: src/main/java/com/_4dconcept/springframework/data/marklogic/core/mapping/MarklogicMappingContext.java
// public class MarklogicMappingContext extends AbstractMappingContext<BasicMarklogicPersistentEntity<?>, MarklogicPersistentProperty> {
// 
//     @Override
//     protected <T> BasicMarklogicPersistentEntity<T> createPersistentEntity(TypeInformation<T> typeInformation) {
//         return new BasicMarklogicPersistentEntity<>(typeInformation);
//     }
// 
//     @Override
//     protected MarklogicPersistentProperty createPersistentProperty(Property property,
//             BasicMarklogicPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) {
//         return new BasicMarklogicPersistentProperty(property, owner, simpleTypeHolder);
//     }
// }


// Path: src/test/java/com/_4dconcept/springframework/data/marklogic/core/convert/MappingMarklogicConverterTest.java
import static org.hamcrest.MatcherAssert.assertThat;
import com._4dconcept.springframework.data.marklogic.core.mapping.Collection;
import com._4dconcept.springframework.data.marklogic.core.mapping.Document;
import com._4dconcept.springframework.data.marklogic.core.mapping.MarklogicMappingContext;
import org.hamcrest.CoreMatchers;
import org.junit.Test;
import org.springframework.core.convert.ConverterNotFoundException;
import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.converter.ConditionalGenericConverter;
import org.springframework.core.convert.converter.GenericConverter;
import org.springframework.lang.Nullable;
import java.util.Arrays;
import java.util.Collections;
import java.util.Set;

        public Set<ConvertiblePair> getConvertibleTypes() {
            return Collections.singleton(new ConvertiblePair(ConvertibleObject.class, String.class));
        }

        @Override
        public Object convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
            return "<empty />";
        }

    }

    static class DocumentConverter implements ConditionalGenericConverter {
        @Override
        public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
            return sourceType.getObjectType().isAnnotationPresent(Document.class);
        }

        @Override
        public Set<ConvertiblePair> getConvertibleTypes() {
            return Collections.singleton(new ConvertiblePair(Object.class, String.class));
        }

        @Override
        public Object convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
            return "<person><id>1</id></person>";
        }

    }

    private MappingMarklogicConverter createConverterWithDelegates(GenericConverter... converters) {
        MappingMarklogicConverter mappingMarklogicConverter = new MappingMarklogicConverter(new MarklogicMappingContext());