// 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 <T> T fromFressianByteArray(byte[] bytes) {
//     return FressianSerialization.fromFressianByteArray(bytes);
// }
// 
// 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/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java
// static byte[] toFressianByteArray(Object o) {
//     return FressianSerialization.toFressianByteArray(o);
// }


import static com.github.rschmitt.collider.Collider.clojureList;
import static com.github.rschmitt.collider.Collider.clojureMap;
import static com.github.rschmitt.collider.Collider.clojureSet;
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize;
import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray;
import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance;
import static com.github.rschmitt.dynamicobject.DynamicObject.toFressianByteArray;
import static java.util.Optional.empty;
import static java.util.Optional.of;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import com.github.rschmitt.collider.ClojureList;
import com.github.rschmitt.collider.ClojureMap;
import com.github.rschmitt.collider.ClojureSet;
    public void mapBuilders() throws Exception {
        ClojureMap<String, Integer> map = clojureMap("key", 3);

        Batch batch = emptyBatch.map2(map);

        assertEquals(map, batch.map());
        fressianRoundTrip(batch);
    }

    @Test
    public void setBuilders() throws Exception {
        ClojureSet<Instant> set = clojureSet(inst);

        Batch batch = emptyBatch.set2(set);

        assertEquals(set, batch.set());
        fressianRoundTrip(batch);
    }

    @Test
    public void listBuilders() throws Exception {
        ClojureList<Optional<String>> list = clojureList(of("a"), empty(), of("c"));

        Batch batch = emptyBatch.list2(list);

        assertEquals(list, batch.list());
        fressianRoundTrip(batch);
    }

    private void fressianRoundTrip(Batch batch) {
// 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 <T> T fromFressianByteArray(byte[] bytes) {
//     return FressianSerialization.fromFressianByteArray(bytes);
// }
// 
// 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/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java
// static byte[] toFressianByteArray(Object o) {
//     return FressianSerialization.toFressianByteArray(o);
// }


// Path: src/test/java/com/github/rschmitt/dynamicobject/ColliderTest.java
import static com.github.rschmitt.collider.Collider.clojureList;
import static com.github.rschmitt.collider.Collider.clojureMap;
import static com.github.rschmitt.collider.Collider.clojureSet;
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize;
import static com.github.rschmitt.dynamicobject.DynamicObject.fromFressianByteArray;
import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance;
import static com.github.rschmitt.dynamicobject.DynamicObject.toFressianByteArray;
import static java.util.Optional.empty;
import static java.util.Optional.of;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import com.github.rschmitt.collider.ClojureList;
import com.github.rschmitt.collider.ClojureMap;
import com.github.rschmitt.collider.ClojureSet;

    public void mapBuilders() throws Exception {
        ClojureMap<String, Integer> map = clojureMap("key", 3);

        Batch batch = emptyBatch.map2(map);

        assertEquals(map, batch.map());
        fressianRoundTrip(batch);
    }

    @Test
    public void setBuilders() throws Exception {
        ClojureSet<Instant> set = clojureSet(inst);

        Batch batch = emptyBatch.set2(set);

        assertEquals(set, batch.set());
        fressianRoundTrip(batch);
    }

    @Test
    public void listBuilders() throws Exception {
        ClojureList<Optional<String>> list = clojureList(of("a"), empty(), of("c"));

        Batch batch = emptyBatch.list2(list);

        assertEquals(list, batch.list());
        fressianRoundTrip(batch);
    }

    private void fressianRoundTrip(Batch batch) {
        Batch actual = fromFressianByteArray(toFressianByteArray(batch));