### Question:
PersistenceTransformations { public static AuthCode toAuthCode(PersistentAuthCode persistentAuthCode) { AuthCode authCode = null; if (persistentAuthCode != null) { authCode = new AuthCode(); authCode.setClientId(persistentAuthCode.getClientId()); authCode.setCode(persistentAuthCode.getCode()); authCode.setCreated(persistentAuthCode.getCreated()); authCode.setId(persistentAuthCode.getId()); authCode.setRedirectUri(persistentAuthCode.getRedirectUri()); authCode.setScope(persistentAuthCode.getScope()); authCode.setState(persistentAuthCode.getState()); authCode.setType(persistentAuthCode.getCode()); authCode.setUserId(persistentAuthCode.getUserId()); authCode.setValid(persistentAuthCode.isValid()); } return authCode; }  static Scope toScope(PersistentScope persistenceScope); static PersistentScope toPersistentScope(Scope scope); static ClientCredentials toClientCredentials(PersistentClientCredentials persistentClientCredentials); static PersistentClientCredentials toPersistentClientCredentials(ClientCredentials clientCredentials); static PersistentAuthCode toPersistentAuthCode(AuthCode authCode); static AuthCode toAuthCode(PersistentAuthCode persistentAuthCode); static PersistentAccessToken toPersistentAccessToken(AccessToken accessToken); static AccessToken toAccessToken(PersistentAccessToken persistentAccessToken); static ApplicationInfo toApplicationInfo(PersistentClientCredentials clientCredentials);  }### Answer:
@Test public void when_no_auth_code_found_return_null() throws Exception { AuthCode authCode = PersistenceTransformations.toAuthCode(null); assertNull(authCode); }