// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java
// static <T> T deserialize(String edn, Class<T> type) {
//     return EdnSerialization.deserialize(edn, type);
// }
// 
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java
// static <D extends DynamicObject<D>> D newInstance(Class<D> type) {
//     return Instances.newInstance(type);
// }


import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize;
import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance;
import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
import static java.util.stream.IntStream.range;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
        binaryRoundTrip(mapSchema);
    }

    @Test
    public void listOfIntegers() {
        ListSchema deserialized = deserialize("{:ints [nil 2 nil 4 nil]}", ListSchema.class);
        List<Integer> builtList = asList(null, 2, null, 4, null);

        ListSchema built = newInstance(ListSchema.class).ints(builtList);

        assertEquals(builtList, deserialized.ints());
        assertEquals(builtList, built.ints());
        binaryRoundTrip(built);
        binaryRoundTrip(deserialized);
    }

    @Test
    public void mapOfIntegersToIntegers() {
        MapSchema deserialized = deserialize("{:ints {1 2, 3 4}}", MapSchema.class);
        Map<Integer, Integer> builtMap = new HashMap<>();
        builtMap.put(1, 2);
        builtMap.put(3, 4);
        MapSchema built = newInstance(MapSchema.class).ints(builtMap);

        assertEquals(builtMap, deserialized.ints());
        assertEquals(builtMap, built.ints());
        binaryRoundTrip(deserialized);
        binaryRoundTrip(built);
    }

// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java
// static <T> T deserialize(String edn, Class<T> type) {
//     return EdnSerialization.deserialize(edn, type);
// }
// 
// Path: src/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java
// static <D extends DynamicObject<D>> D newInstance(Class<D> type) {
//     return Instances.newInstance(type);
// }


// Path: src/test/java/com/github/rschmitt/dynamicobject/CollectionsTest.java
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize;
import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance;
import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;
import static java.util.stream.IntStream.range;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

        binaryRoundTrip(mapSchema);
    }

    @Test
    public void listOfIntegers() {
        ListSchema deserialized = deserialize("{:ints [nil 2 nil 4 nil]}", ListSchema.class);
        List<Integer> builtList = asList(null, 2, null, 4, null);

        ListSchema built = newInstance(ListSchema.class).ints(builtList);

        assertEquals(builtList, deserialized.ints());
        assertEquals(builtList, built.ints());
        binaryRoundTrip(built);
        binaryRoundTrip(deserialized);
    }

    @Test
    public void mapOfIntegersToIntegers() {
        MapSchema deserialized = deserialize("{:ints {1 2, 3 4}}", MapSchema.class);
        Map<Integer, Integer> builtMap = new HashMap<>();
        builtMap.put(1, 2);
        builtMap.put(3, 4);
        MapSchema built = newInstance(MapSchema.class).ints(builtMap);

        assertEquals(builtMap, deserialized.ints());
        assertEquals(builtMap, built.ints());
        binaryRoundTrip(deserialized);
        binaryRoundTrip(built);
    }

    @Test