### Question:
DatabaseUserGroupProvider implements ConfigurableUserGroupProvider { @Override public User addUser(final User user) throws AuthorizationAccessException { Validate.notNull(user); final String sql = "INSERT INTO UGP_USER(IDENTIFIER, IDENTITY) VALUES (?, ?)"; jdbcTemplate.update(sql, new Object[] {user.getIdentifier(), user.getIdentity()}); return user; }  @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 testAddUser() { configureWithInitialUsers(); final Set<User> users = userGroupProvider.getUsers(); assertEquals(0, users.size()); final User user1 = new User.Builder() .identifier(UUID.randomUUID().toString()) .identity("user1") .build(); final User createdUser1 = userGroupProvider.addUser(user1); assertNotNull(createdUser1); final Set<User> usersAfterCreate = userGroupProvider.getUsers(); assertEquals(1, usersAfterCreate.size()); final User retrievedUser1 = usersAfterCreate.stream().findFirst().get(); assertEquals(user1.getIdentifier(), retrievedUser1.getIdentifier()); assertEquals(user1.getIdentity(), retrievedUser1.getIdentity()); }