List<GWTJahiaUser> result = new ArrayList<GWTJahiaUser>();
users = userManagerService.searchUsers(criterias);
if (users != null) {
Iterator iterator = users.iterator();
JahiaUser user;
GWTJahiaUser data;
while (iterator.hasNext()) {
user = (JahiaUser) iterator.next();
data = new GWTJahiaUser(user.getUsername(), user.getUserKey());
Properties p = user.getProperties();
for (Object o : p.keySet()) {
data.set((String) o, p.get(o));
}
data.setProvider(user.getProviderName());
result.add(data);
}
}
Collections.sort(result, new Comparator<GWTJahiaUser>() {
public int compare(GWTJahiaUser o1, GWTJahiaUser o2) {