// Path: 1_valueobjects/x_tests/src/main/java/org/zalando/techtalks/hackingjava/valueobjects/tests/BaseUserTest.java
// public abstract class BaseUserTest {
//     protected static final String FIRST_NAME = "Fred";
//     protected static final String LAST_NAME = "Flintstone";
//     protected static final LocalDate BIRTH_DATE = LocalDate.MIN;
//     protected static final String STREET = "301 Cobblestone Way";
//     protected static final int ZIP_CODE = 70777;
//     protected static final String CITY = "Bedrock";
// 
//     @Test
//     public void equalsAndHashCodeAreSymmetrical() {
//         final Object user1 = createUser();
//         final Object user2 = createUser();
//         assertThat(user1, is(equalTo(user2)));
//         assertThat(user2, is(equalTo(user1)));
//         assertThat(user1.hashCode(), is(equalTo(user2.hashCode())));
//     }
// 
//     @Test
//     public void toStringIsConsistent() {
//         assertThat(createUser().toString(), is(equalTo(createUser().toString())));
//         final String s = createUser().toString();
//         assertThat(s, containsString(FIRST_NAME));
//         assertThat(s, containsString(LAST_NAME));
//         assertThat(s, containsString(CITY));
//     }
// 
//     @SuppressWarnings({"unchecked", "rawtypes"}) @Test
//     public void compareToIsSymmetrical() {
//         final Object left = createUser();
//         final Object right = createUser();
//         assertThat(left, instanceOf(Comparable.class));
//         assertThat(right, instanceOf(Comparable.class));
//         assertThat(((Comparable) left).compareTo(right),
//                    is(equalTo(((Comparable) right).compareTo(left))));
//     }
// 
//     @Test
//     public void propertyMapHasCorrectValues() {
//         final Object instance = createUser();
//         final Map<String, Object> userPropertyMap = getPropertyMap(instance);
//         assertThat(userPropertyMap, hasEntry("firstName", FIRST_NAME));
//         assertThat(userPropertyMap, hasEntry("lastName", LAST_NAME));
//         assertThat(userPropertyMap, hasEntry("birthDate", BIRTH_DATE));
//         assertThat(userPropertyMap, hasKey("addresses"));
// 
// 
//         final Object addresses = userPropertyMap.get("addresses");
//         assertThat(addresses, is(instanceOf(List.class)));
//         final List<?> list = List.class.cast(addresses);
//         assertThat(list, hasSize(1));
// 
//         final Map<String, Object> addressPropertyMap = getPropertyMap(list.get(0));
//         assertThat(addressPropertyMap, hasEntry("street", STREET));
//         assertThat(addressPropertyMap, hasEntry("zipCode", ZIP_CODE));
//         assertThat(addressPropertyMap, hasEntry("city", CITY));
// 
// 
//     }
// 
//     private static Map<String, Object> getPropertyMap(final Object instance) {
//         final Map<String, Object> propertyMap = new TreeMap<>();
//         try {
//             Arrays.stream(Introspector.getBeanInfo(instance.getClass(), Object.class)
//                                       .getPropertyDescriptors())
//                   .filter((it) -> it.getReadMethod() != null)
//                   .forEach((propertyDescriptor) -> {
//                       final Method method = propertyDescriptor.getReadMethod();
//                       try {
//                           final Object result = method.invoke(instance);
//                           propertyMap.put(propertyDescriptor.getName(), result);
//                       } catch (IllegalAccessException | InvocationTargetException e) {
//                           throw new IllegalStateException(e);
//                       }
//                   });
//         } catch (IntrospectionException e) {
//             throw new IllegalStateException(e);
//         }
//         return propertyMap;
//     }
// 
//     protected abstract Object createUser();
// }
// 
// Path: 1_valueobjects/2_autovalue/src/main/java/org/zalando/techtalks/hackingjava/valueobjects/autovalue/builder/User.java
// public static Builder userBuilder() {return new AutoValue_User.Builder();}


import org.zalando.techtalks.hackingjava.valueobjects.tests.BaseUserTest;
import static org.zalando.techtalks.hackingjava.valueobjects.autovalue.builder.Address
    .addressBuilder;
import static org.zalando.techtalks.hackingjava.valueobjects.autovalue.builder.User.userBuilder;
package org.zalando.techtalks.hackingjava.valueobjects.autovalue.builder;



public class BuilderUserTest extends BaseUserTest {

    @Override protected Object createUser() {
// Path: 1_valueobjects/x_tests/src/main/java/org/zalando/techtalks/hackingjava/valueobjects/tests/BaseUserTest.java
// public abstract class BaseUserTest {
//     protected static final String FIRST_NAME = "Fred";
//     protected static final String LAST_NAME = "Flintstone";
//     protected static final LocalDate BIRTH_DATE = LocalDate.MIN;
//     protected static final String STREET = "301 Cobblestone Way";
//     protected static final int ZIP_CODE = 70777;
//     protected static final String CITY = "Bedrock";
// 
//     @Test
//     public void equalsAndHashCodeAreSymmetrical() {
//         final Object user1 = createUser();
//         final Object user2 = createUser();
//         assertThat(user1, is(equalTo(user2)));
//         assertThat(user2, is(equalTo(user1)));
//         assertThat(user1.hashCode(), is(equalTo(user2.hashCode())));
//     }
// 
//     @Test
//     public void toStringIsConsistent() {
//         assertThat(createUser().toString(), is(equalTo(createUser().toString())));
//         final String s = createUser().toString();
//         assertThat(s, containsString(FIRST_NAME));
//         assertThat(s, containsString(LAST_NAME));
//         assertThat(s, containsString(CITY));
//     }
// 
//     @SuppressWarnings({"unchecked", "rawtypes"}) @Test
//     public void compareToIsSymmetrical() {
//         final Object left = createUser();
//         final Object right = createUser();
//         assertThat(left, instanceOf(Comparable.class));
//         assertThat(right, instanceOf(Comparable.class));
//         assertThat(((Comparable) left).compareTo(right),
//                    is(equalTo(((Comparable) right).compareTo(left))));
//     }
// 
//     @Test
//     public void propertyMapHasCorrectValues() {
//         final Object instance = createUser();
//         final Map<String, Object> userPropertyMap = getPropertyMap(instance);
//         assertThat(userPropertyMap, hasEntry("firstName", FIRST_NAME));
//         assertThat(userPropertyMap, hasEntry("lastName", LAST_NAME));
//         assertThat(userPropertyMap, hasEntry("birthDate", BIRTH_DATE));
//         assertThat(userPropertyMap, hasKey("addresses"));
// 
// 
//         final Object addresses = userPropertyMap.get("addresses");
//         assertThat(addresses, is(instanceOf(List.class)));
//         final List<?> list = List.class.cast(addresses);
//         assertThat(list, hasSize(1));
// 
//         final Map<String, Object> addressPropertyMap = getPropertyMap(list.get(0));
//         assertThat(addressPropertyMap, hasEntry("street", STREET));
//         assertThat(addressPropertyMap, hasEntry("zipCode", ZIP_CODE));
//         assertThat(addressPropertyMap, hasEntry("city", CITY));
// 
// 
//     }
// 
//     private static Map<String, Object> getPropertyMap(final Object instance) {
//         final Map<String, Object> propertyMap = new TreeMap<>();
//         try {
//             Arrays.stream(Introspector.getBeanInfo(instance.getClass(), Object.class)
//                                       .getPropertyDescriptors())
//                   .filter((it) -> it.getReadMethod() != null)
//                   .forEach((propertyDescriptor) -> {
//                       final Method method = propertyDescriptor.getReadMethod();
//                       try {
//                           final Object result = method.invoke(instance);
//                           propertyMap.put(propertyDescriptor.getName(), result);
//                       } catch (IllegalAccessException | InvocationTargetException e) {
//                           throw new IllegalStateException(e);
//                       }
//                   });
//         } catch (IntrospectionException e) {
//             throw new IllegalStateException(e);
//         }
//         return propertyMap;
//     }
// 
//     protected abstract Object createUser();
// }
// 
// Path: 1_valueobjects/2_autovalue/src/main/java/org/zalando/techtalks/hackingjava/valueobjects/autovalue/builder/User.java
// public static Builder userBuilder() {return new AutoValue_User.Builder();}


// Path: 1_valueobjects/2_autovalue/src/test/java/org/zalando/techtalks/hackingjava/valueobjects/autovalue/builder/BuilderUserTest.java
import org.zalando.techtalks.hackingjava.valueobjects.tests.BaseUserTest;
import static org.zalando.techtalks.hackingjava.valueobjects.autovalue.builder.Address
    .addressBuilder;
import static org.zalando.techtalks.hackingjava.valueobjects.autovalue.builder.User.userBuilder;

package org.zalando.techtalks.hackingjava.valueobjects.autovalue.builder;



public class BuilderUserTest extends BaseUserTest {

    @Override protected Object createUser() {
        return userBuilder()