### Question:
DatabaseUserGroupProvider implements ConfigurableUserGroupProvider { @Override public User getUser(final String identifier) throws AuthorizationAccessException { Validate.notBlank(identifier); final DatabaseUser databaseUser = getDatabaseUser(identifier); if (databaseUser == null) { return null; } return mapToUser(databaseUser); }  @AuthorizerContext void setDataSource(final DataSource dataSource); @AuthorizerContext void setIdentityMapper(final IdentityMapper identityMapper); @Override void initialize(final UserGroupProviderInitializationContext initializationContext); @Override void onConfigured(final AuthorizerConfigurationContext configurationContext); @Override void preDestruction(); @Override String getFingerprint(); @Override void inheritFingerprint(final String fingerprint); @Override void checkInheritability(final String proposedFingerprint); @Override User addUser(final User user); @Override User updateUser(final User user); @Override Set<User> getUsers(); @Override User getUser(final String identifier); @Override User getUserByIdentity(final String identity); @Override UserAndGroups getUserAndGroups(final String userIdentity); @Override User deleteUser(final User user); @Override Group addGroup(final Group group); @Override Group updateGroup(final Group group); @Override Set<Group> getGroups(); @Override Group getGroup(final String groupIdentifier); @Override Group deleteGroup(final Group group);  }### Answer:
@Test public void testGetUserByIdentifierWhenExists() { configureWithInitialUsers(); final String userIdentifier = UUID.randomUUID().toString(); final String userIdentity = "user1"; createUser(userIdentifier, userIdentity); final User retrievedUser1 = userGroupProvider.getUser(userIdentifier); assertNotNull(retrievedUser1); assertEquals(userIdentifier, retrievedUser1.getIdentifier()); assertEquals(userIdentity, retrievedUser1.getIdentity()); }
@Test public void testGetUserByIdentifierWhenDoesNotExist() { configureWithInitialUsers(); final User retrievedUser1 = userGroupProvider.getUser("does-not-exist"); assertNull(retrievedUser1); }