// Path: src/test/java/com/moozvine/detox/testtypes/AnotherSimpleType.java
// @GenerateDTO
// public interface AnotherSimpleType extends Serializable {
//   String getSomeOtherString();
// }
// 
// Path: src/test/java/com/moozvine/detox/testtypes/SimpleType.java
// @GenerateDTO
// public interface SimpleType extends Serializable {
//   String getSomeString();
//   int getAnInt();
// }


import com.google.common.collect.ImmutableList;
import com.moozvine.detox.testtypes.AnotherSimpleType;
import com.moozvine.detox.testtypes.SimpleType;
import com.moozvine.detox.testtypes.complexhierarchies.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
            .withValue("user value")
            .build())
        .build();

    final String serializedUser = service.serialize(userToSerialize);
    final User deserializedUser = (User) service.deserialize(serializedUser);

    assertEquals(userToSerialize.getToken().getValue(), deserializedUser.getToken().getValue());

    final FooUser fooUserToSerialize = FooUserBuilder.newBuilder()
        .withToken(FooTokenBuilder.newBuilder()
            .withValue("foo user value")
            .withFooCount(2)
            .build())
        .build();

    final String serializedFooUser = service.serialize(fooUserToSerialize, FooUser.class);
    assertThat(serializedFooUser, containsString(FooUser.class.getName()));

    final FooUser deserializedFooUser = (FooUser) service.deserialize(serializedFooUser);

    assertEquals(fooUserToSerialize.getToken().getFooCount(), deserializedFooUser.getToken().getFooCount());
    assertEquals(fooUserToSerialize.getToken().getValue(), deserializedFooUser.getToken().getValue());
  }

  /**
   * Compare with {@link FailureTests#serializingAnObjectWithMultipleGenerateDTOInterfacesToUnspecifiedInterface()}
   */
  @Test
  public void serializingAnObjectWithMultipleGenerateDTOInterfacesToSpecifiedInterface() throws Exception {
// Path: src/test/java/com/moozvine/detox/testtypes/AnotherSimpleType.java
// @GenerateDTO
// public interface AnotherSimpleType extends Serializable {
//   String getSomeOtherString();
// }
// 
// Path: src/test/java/com/moozvine/detox/testtypes/SimpleType.java
// @GenerateDTO
// public interface SimpleType extends Serializable {
//   String getSomeString();
//   int getAnInt();
// }


// Path: src/test/java/com/moozvine/detox/SerializationServiceWithComplexHierarchies.java
import com.google.common.collect.ImmutableList;
import com.moozvine.detox.testtypes.AnotherSimpleType;
import com.moozvine.detox.testtypes.SimpleType;
import com.moozvine.detox.testtypes.complexhierarchies.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;

            .withValue("user value")
            .build())
        .build();

    final String serializedUser = service.serialize(userToSerialize);
    final User deserializedUser = (User) service.deserialize(serializedUser);

    assertEquals(userToSerialize.getToken().getValue(), deserializedUser.getToken().getValue());

    final FooUser fooUserToSerialize = FooUserBuilder.newBuilder()
        .withToken(FooTokenBuilder.newBuilder()
            .withValue("foo user value")
            .withFooCount(2)
            .build())
        .build();

    final String serializedFooUser = service.serialize(fooUserToSerialize, FooUser.class);
    assertThat(serializedFooUser, containsString(FooUser.class.getName()));

    final FooUser deserializedFooUser = (FooUser) service.deserialize(serializedFooUser);

    assertEquals(fooUserToSerialize.getToken().getFooCount(), deserializedFooUser.getToken().getFooCount());
    assertEquals(fooUserToSerialize.getToken().getValue(), deserializedFooUser.getToken().getValue());
  }

  /**
   * Compare with {@link FailureTests#serializingAnObjectWithMultipleGenerateDTOInterfacesToUnspecifiedInterface()}
   */
  @Test
  public void serializingAnObjectWithMultipleGenerateDTOInterfacesToSpecifiedInterface() throws Exception {
    class MultipleGenerateDTOs implements SimpleType, AnotherSimpleType {