### Question:
JpaOAuthConsumerStoreConverter implements ModelConverter<OAuthConsumerStore, JpaOAuthConsumerStore> { @Override public JpaOAuthConsumerStore convert(OAuthConsumerStore source) { return source instanceof JpaOAuthConsumerStore ? (JpaOAuthConsumerStore) source : createEntity(source); }  @Override Class<OAuthConsumerStore> getSourceType(); @Override JpaOAuthConsumerStore convert(OAuthConsumerStore source);  }### Answer:
@Test public void noConversion() { OAuthConsumerStore oAuthConsumerStore = new JpaOAuthConsumerStore(); assertThat(oAuthConsumerStoreConverter.convert(oAuthConsumerStore), is(sameInstance(oAuthConsumerStore))); }
@Test public void nullConversion() { OAuthConsumerStore oAuthConsumerStore = null; assertThat(oAuthConsumerStoreConverter.convert(oAuthConsumerStore), is(nullValue())); }
@Test public void newOAuthConsumerStore() { OAuthConsumerStore oAuthConsumerStore = new OAuthConsumerStoreImpl(); oAuthConsumerStore.setId("1"); oAuthConsumerStore.setServiceName("servicename"); oAuthConsumerStore.setCallbackUrl("callbackurl"); oAuthConsumerStore.setConsumerKey("key"); oAuthConsumerStore.setConsumerSecret("secret"); oAuthConsumerStore.setGadgetUri("gadgeturi"); oAuthConsumerStore.setKeyName("key"); oAuthConsumerStore.setKeyType(OAuthConsumerStore.KeyType.HMAC_SYMMETRIC); JpaOAuthConsumerStore converted = oAuthConsumerStoreConverter.convert(oAuthConsumerStore); assertThat(converted, is(not(sameInstance(oAuthConsumerStore)))); assertThat(converted, is(instanceOf(JpaOAuthConsumerStore.class))); assertThat(converted.getId(), is(equalTo(oAuthConsumerStore.getId()))); assertThat(converted.getServiceName(), is(equalTo(oAuthConsumerStore.getServiceName()))); assertThat(converted.getCallbackUrl(), is(equalTo(oAuthConsumerStore.getCallbackUrl()))); assertThat(converted.getConsumerKey(), is(equalTo(oAuthConsumerStore.getConsumerKey()))); assertThat(converted.getConsumerSecret(), is(equalTo(oAuthConsumerStore.getConsumerSecret()))); assertThat(converted.getEntityId().toString(), is(equalTo(oAuthConsumerStore.getId()))); assertThat(converted.getGadgetUri(), is(equalTo(oAuthConsumerStore.getGadgetUri()))); assertThat(converted.getKeyName(), is(equalTo(oAuthConsumerStore.getKeyName()))); assertThat(converted.getKeyType(), is(equalTo(oAuthConsumerStore.getKeyType()))); }