### Question:
JpaApplicationDataConverter implements ModelConverter<ApplicationData, JpaApplicationData> { @Override public JpaApplicationData convert(ApplicationData source) { return source instanceof JpaApplicationData ? (JpaApplicationData) source : createEntity(source); }  @Override Class<ApplicationData> getSourceType(); @Override JpaApplicationData convert(ApplicationData source);  }### Answer:
@Test public void noConversion() { ApplicationData applicationData = new JpaApplicationData(); assertThat(applicationDataConverter.convert(applicationData), is(sameInstance(applicationData))); }
@Test public void nullConversion() { ApplicationData applicationData = null; assertThat(applicationDataConverter.convert(applicationData), is(nullValue())); }
@Test public void newApplicationData() { ApplicationData applicationData = new ApplicationDataImpl(); applicationData.setId("1"); applicationData.setAppUrl("url"); applicationData.setData(new HashMap<String, Object>()); applicationData.setUserId("userid"); JpaApplicationData converted = applicationDataConverter.convert(applicationData); assertThat(converted, is(not(sameInstance(applicationData)))); assertThat(converted, is(instanceOf(JpaApplicationData.class))); assertThat(converted.getId(), is(equalTo(applicationData.getId()))); assertThat(converted.getEntityId().toString(), is(equalTo(applicationData.getId()))); assertThat(converted.getAppUrl(), is(equalTo(applicationData.getAppUrl()))); assertThat(converted.getData(), is(equalTo(applicationData.getData()))); assertThat(converted.getUserId(), is(equalTo(applicationData.getUserId()))); }