### Question:
JpaOAuthTokenInfoConverter implements ModelConverter<OAuthTokenInfo, JpaOAuthTokenInfo> { @Override public JpaOAuthTokenInfo convert(OAuthTokenInfo source) { return source instanceof JpaOAuthTokenInfo ? (JpaOAuthTokenInfo) source : createEntity(source); }  @Override Class<OAuthTokenInfo> getSourceType(); @Override JpaOAuthTokenInfo convert(OAuthTokenInfo source);  }### Answer:
@Test public void noConversion() { OAuthTokenInfo oAuthTokenInfo = new JpaOAuthTokenInfo(); assertThat(oAuthTokenInfoConverter.convert(oAuthTokenInfo), is(sameInstance(oAuthTokenInfo))); }
@Test public void nullConversion() { OAuthTokenInfo oAuthTokenInfo = null; assertThat(oAuthTokenInfoConverter.convert(oAuthTokenInfo), is(nullValue())); }
@Test public void newOAuthTokenInfo() { OAuthTokenInfo oAuthTokenInfo = new OAuthTokenInfoImpl(); oAuthTokenInfo.setId("1"); oAuthTokenInfo.setAccessToken("accesstoken"); oAuthTokenInfo.setAppUrl("appurl"); oAuthTokenInfo.setModuleId("moduleid"); oAuthTokenInfo.setServiceName("servicename"); oAuthTokenInfo.setSessionHandle("sessionhandle"); oAuthTokenInfo.setTokenExpireMillis(99L); oAuthTokenInfo.setTokenName("tokenname"); oAuthTokenInfo.setTokenSecret("tokensecret"); oAuthTokenInfo.setUserId("userid"); JpaOAuthTokenInfo converted = oAuthTokenInfoConverter.convert(oAuthTokenInfo); assertThat(converted, is(not(sameInstance(oAuthTokenInfo)))); assertThat(converted, is(instanceOf(JpaOAuthTokenInfo.class))); assertThat(converted.getId(), is(equalTo(oAuthTokenInfo.getId()))); assertThat(converted.getAccessToken(), is(equalTo(oAuthTokenInfo.getAccessToken()))); assertThat(converted.getAppUrl(), is(equalTo(oAuthTokenInfo.getAppUrl()))); assertThat(converted.getModuleId(), is(equalTo(oAuthTokenInfo.getModuleId()))); assertThat(converted.getServiceName(), is(equalTo(oAuthTokenInfo.getServiceName()))); assertThat(converted.getSessionHandle(), is(equalTo(oAuthTokenInfo.getSessionHandle()))); assertThat(converted.getTokenExpireMillis(), is(equalTo(oAuthTokenInfo.getTokenExpireMillis()))); assertThat(converted.getTokenName(), is(equalTo(oAuthTokenInfo.getTokenName()))); assertThat(converted.getTokenSecret(), is(equalTo(oAuthTokenInfo.getTokenSecret()))); assertThat(converted.getUserId(), is(equalTo(oAuthTokenInfo.getUserId()))); }