Exemple #1
0
 @Override
 public int compare(User arg0, User arg1) {
   if (arg0.getExperience() < arg1.getExperience()) {
     return +1;
   } else if (arg0.getExperience() == arg1.getExperience()) {
     return 0;
   }
   return -1;
 }
Exemple #2
0
 private List<User> searchForHelpAmongFriends(User u, List<String> abilities) {
   List<User> unfiltered = friendshipBean.getFriends(u);
   List<User> filtered = new ArrayList<User>();
   for (User friend : unfiltered) {
     if (isSubsetOf(abilities, friend.getAbilities())) {
       filtered.add(friend);
     }
   }
   return filtered;
 }