// Path: src/main/java/com/exmertec/dummie/Dummie.java
// public static <T> T create(Class<T> type) {
//     return prepare(type).build();
// }
// 
// Path: src/main/java/com/exmertec/dummie/Dummie.java
// public static <T> DummyBuilder<T> prepare(Class<T> type) {
//     return new DummyBuilderFactory().prepare(type);
// }


import static com.exmertec.dummie.Dummie.create;
import static com.exmertec.dummie.Dummie.prepare;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
package com.exmertec.dummie;



public class OverrideTest {

    @Test
    public void should_create_object() {
        NestingData1 nestingData1 = create(NestingData1.class);

        assertThat(nestingData1, not(nullValue()));
        assertThat(nestingData1.getNestingData2s(), not(nullValue()));
        assertThat(nestingData1.getNestingData2s().getData(), not(nullValue()));
    }

    @Test
    public void should_prepare_class_and_success_cached() throws Exception {
        NestingData1 nestingData1 = prepare(NestingData1.class).override(String.class, "abc").build();

        assertThat(nestingData1, not(nullValue()));
        assertThat(nestingData1.getName(), equalTo("abc"));
        assertThat(nestingData1.getNestingData2s(), not(nullValue()));
        assertThat(nestingData1.getNestingData2s().getData(), not(nullValue()));
    }

    @Test
    public void should_prepare_class_and_field_then_first_lookup_field() throws Exception {
        NestingData1 nestingData1 = prepare(NestingData1.class)
            .override(String.class, "abc")
            .override("name", "edf")
            .build();

        assertThat(nestingData1, not(nullValue()));
        assertThat(nestingData1.getName(), equalTo("edf"));
        assertThat(nestingData1.getNestingData2s(), not(nullValue()));
        assertThat(nestingData1.getNestingData2s().getData(), not(nullValue()));
    }

    @Test
    public void should_prepare_class_and_another_same_type_field_then_give_class_cache() throws Exception {
// Path: src/main/java/com/exmertec/dummie/Dummie.java
// public static <T> T create(Class<T> type) {
//     return prepare(type).build();
// }
// 
// Path: src/main/java/com/exmertec/dummie/Dummie.java
// public static <T> DummyBuilder<T> prepare(Class<T> type) {
//     return new DummyBuilderFactory().prepare(type);
// }


// Path: src/test/java/com/exmertec/dummie/OverrideTest.java
import static com.exmertec.dummie.Dummie.create;
import static com.exmertec.dummie.Dummie.prepare;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;

package com.exmertec.dummie;



public class OverrideTest {

    @Test
    public void should_create_object() {
        NestingData1 nestingData1 = create(NestingData1.class);

        assertThat(nestingData1, not(nullValue()));
        assertThat(nestingData1.getNestingData2s(), not(nullValue()));
        assertThat(nestingData1.getNestingData2s().getData(), not(nullValue()));
    }

    @Test
    public void should_prepare_class_and_success_cached() throws Exception {
        NestingData1 nestingData1 = prepare(NestingData1.class).override(String.class, "abc").build();

        assertThat(nestingData1, not(nullValue()));
        assertThat(nestingData1.getName(), equalTo("abc"));
        assertThat(nestingData1.getNestingData2s(), not(nullValue()));
        assertThat(nestingData1.getNestingData2s().getData(), not(nullValue()));
    }

    @Test
    public void should_prepare_class_and_field_then_first_lookup_field() throws Exception {
        NestingData1 nestingData1 = prepare(NestingData1.class)
            .override(String.class, "abc")
            .override("name", "edf")
            .build();

        assertThat(nestingData1, not(nullValue()));
        assertThat(nestingData1.getName(), equalTo("edf"));
        assertThat(nestingData1.getNestingData2s(), not(nullValue()));
        assertThat(nestingData1.getNestingData2s().getData(), not(nullValue()));
    }

    @Test
    public void should_prepare_class_and_another_same_type_field_then_give_class_cache() throws Exception {
        NestingData1 nestingData1 = prepare(NestingData1.class)