// 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/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java
// static String serialize(Object o) {
//     return EdnSerialization.serialize(o);
// }


import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize;
import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance;
import static com.github.rschmitt.dynamicobject.DynamicObject.serialize;
import static java.util.Arrays.asList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.time.Instant;
import java.util.List;
import java.util.Optional;
import org.junit.jupiter.api.Test;
        assertEquals(some.rawStr(), Optional.of("some string"));
        assertEquals(nothing.rawStr(), Optional.empty());
    }

    @Test
    public void intPresent() {
        OptWrapper instance = deserialize("{:i 24601}", OptWrapper.class).validate();
        OptWrapper expected = newInstance(OptWrapper.class).i(Optional.of(24601)).validate();

        assertEquals(Integer.valueOf(24601), instance.i().get());
        assertEquals(expected, instance);
    }

    @Test
    public void listPresent() {
        OptWrapper instance = deserialize("{:ints [1 2 3]}", OptWrapper.class).validate();
        OptWrapper expected = newInstance(OptWrapper.class).ints(Optional.of(asList(1, 2, 3))).validate();

        assertEquals(asList(1, 2, 3), instance.ints().get());
        assertEquals(expected, instance);
    }

    @Test
    public void instantPresent() {
        String edn = "{:inst #inst \"1985-04-12T23:20:50.520-00:00\"}";
        Instant expected = Instant.parse("1985-04-12T23:20:50.52Z");

        OptWrapper instance = deserialize(edn, OptWrapper.class).validate();

        assertEquals(expected, instance.inst().get());
// 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/main/java/com/github/rschmitt/dynamicobject/DynamicObject.java
// static String serialize(Object o) {
//     return EdnSerialization.serialize(o);
// }


// Path: src/test/java/com/github/rschmitt/dynamicobject/OptionalTest.java
import static com.github.rschmitt.dynamicobject.DynamicObject.deserialize;
import static com.github.rschmitt.dynamicobject.DynamicObject.newInstance;
import static com.github.rschmitt.dynamicobject.DynamicObject.serialize;
import static java.util.Arrays.asList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.time.Instant;
import java.util.List;
import java.util.Optional;
import org.junit.jupiter.api.Test;

        assertEquals(some.rawStr(), Optional.of("some string"));
        assertEquals(nothing.rawStr(), Optional.empty());
    }

    @Test
    public void intPresent() {
        OptWrapper instance = deserialize("{:i 24601}", OptWrapper.class).validate();
        OptWrapper expected = newInstance(OptWrapper.class).i(Optional.of(24601)).validate();

        assertEquals(Integer.valueOf(24601), instance.i().get());
        assertEquals(expected, instance);
    }

    @Test
    public void listPresent() {
        OptWrapper instance = deserialize("{:ints [1 2 3]}", OptWrapper.class).validate();
        OptWrapper expected = newInstance(OptWrapper.class).ints(Optional.of(asList(1, 2, 3))).validate();

        assertEquals(asList(1, 2, 3), instance.ints().get());
        assertEquals(expected, instance);
    }

    @Test
    public void instantPresent() {
        String edn = "{:inst #inst \"1985-04-12T23:20:50.520-00:00\"}";
        Instant expected = Instant.parse("1985-04-12T23:20:50.52Z");

        OptWrapper instance = deserialize(edn, OptWrapper.class).validate();

        assertEquals(expected, instance.inst().get());
        assertEquals(edn, serialize(instance));