}
private List<User> loadUsers(Map roles, ResultSet result) throws SQLException {
List<User> users = new ArrayList<User>();
User user = null;
IUser prevUser = null;
while (result.next()) {
String userName = result.getString(1);
if (prevUser == null || !userName.equals(prevUser.getUserName())) {
if (user != null) {
users.add(user);
}
user = new User();
user.setUserName(userName);