### Question:
JpaAddressConverter implements ModelConverter<Address, JpaAddress> { @Override public JpaAddress convert(Address source) { return source instanceof JpaAddress ? (JpaAddress) source : createEntity(source); }  @Override Class<Address> getSourceType(); @Override JpaAddress convert(Address source);  }### Answer:
@Test public void noConversion() { Address address = new JpaAddress(); assertThat(addressConverter.convert(address), is(sameInstance(address))); }
@Test public void nullConversion() { Address address = null; 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)); }