// Path: src/test/java/com/github/rschmitt/dynamicobject/TestUtils.java
// public static void assertEquivalent(String expected, String actual) {
//     assertEquals(genericRead(expected), genericRead(actual));
// }


import static com.github.rschmitt.dynamicobject.TestUtils.assertEquivalent;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
import clojure.lang.PersistentHashMap;
package com.github.rschmitt.dynamicobject;




public class BuilderTest {
    @Test
    public void createEmptyInstance() {
        Buildable obj = DynamicObject.newInstance(Buildable.class);
        assertEquals(PersistentHashMap.EMPTY, obj.getMap());
        assertEquals("{}", DynamicObject.serialize(obj));
    }

    @Test
    public void invokeBuilderMethod() {
        Buildable obj = DynamicObject.newInstance(Buildable.class).str("string");
        assertEquals("{:str \"string\"}", DynamicObject.serialize(obj));
        assertEquals("string", obj.str());
    }

    @Test
    public void invokeBuilderWithPrimitive() {
        Buildable obj = DynamicObject.newInstance(Buildable.class).i(4).s((short) 127).l(Long.MAX_VALUE).d(3.14).f((float) 3.14);
// Path: src/test/java/com/github/rschmitt/dynamicobject/TestUtils.java
// public static void assertEquivalent(String expected, String actual) {
//     assertEquals(genericRead(expected), genericRead(actual));
// }


// Path: src/test/java/com/github/rschmitt/dynamicobject/BuilderTest.java
import static com.github.rschmitt.dynamicobject.TestUtils.assertEquivalent;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
import clojure.lang.PersistentHashMap;

package com.github.rschmitt.dynamicobject;




public class BuilderTest {
    @Test
    public void createEmptyInstance() {
        Buildable obj = DynamicObject.newInstance(Buildable.class);
        assertEquals(PersistentHashMap.EMPTY, obj.getMap());
        assertEquals("{}", DynamicObject.serialize(obj));
    }

    @Test
    public void invokeBuilderMethod() {
        Buildable obj = DynamicObject.newInstance(Buildable.class).str("string");
        assertEquals("{:str \"string\"}", DynamicObject.serialize(obj));
        assertEquals("string", obj.str());
    }

    @Test
    public void invokeBuilderWithPrimitive() {
        Buildable obj = DynamicObject.newInstance(Buildable.class).i(4).s((short) 127).l(Long.MAX_VALUE).d(3.14).f((float) 3.14);
        assertEquivalent("{:f 3.14, :d 3.14, :l 9223372036854775807, :s 127, :i 4}", DynamicObject.serialize(obj));