assertThat(addressConverter.convert(address), is(nullValue()));
}
@Test
public void newAddress() {
Address address = new AddressImpl();
address.setStreetAddress("1600 Pennsylvania Avenue");
address.setLocality("Washington DC");
address.setCountry("USA");
address.setRegion("Washington DC");
address.setPrimary(true);
JpaAddress converted = addressConverter.convert(address);
assertThat(converted, is(not(sameInstance(address))));
assertThat(converted, is(instanceOf(JpaAddress.class)));
assertThat(converted.getStreetAddress(), is(equalTo(address.getStreetAddress())));
assertThat(converted.getLocality(), is(equalTo(address.getLocality())));
assertThat(converted.getCountry(), is(equalTo(address.getCountry())));
assertThat(converted.getRegion(), is(equalTo(address.getRegion())));
assertThat(converted.getPrimary(), is(true));
}