UserDao extends HibernateDao<User, String> { public List<Search> getUserSearches (User user) { Set<Search> searches = read (user.getUUID ()).getPreferences (). getSearches (); List<Search> list = new ArrayList<Search> (searches); Collections.sort (list, new Comparator<Search> () { @Override public int compare (Search arg0, Search arg1) { return arg0.getValue ().compareTo (arg1.getValue ()); } }); return list; }  User getByName(final String name); @Override void delete(final User user); @SuppressWarnings ("unchecked") List<User> readNotAdmin(); Iterator<User> iterate(final String filter, int skip); Iterator<User> scrollAll(String filter, int skip); int countNotAdmin(String filter); int countAll(String filter); String computeUserCode(User user); User getUserFromUserCode(String code); void lockUser(User user, String reason); void unlockUser(User user, Class<? extends AccessRestriction> car); void createTmpUser(User user); @Override User create(User u); User createWithoutMail(User user); void registerTmpUser(User u); boolean isTmpUser(User u); void cleanupTmpUser(int max_days); User getRootUser(); boolean isRootUser(User user); void storeUserSearch(User user, String request, String footprint,
         HashMap<String, String> advanced, String complete); void removeUserSearch(User user, String uuid); void activateUserSearchNotification(String uuid, boolean notify); void clearUserSearches(User user); List<Search> getUserSearches(User user); Iterator<User> getUsersByFilter(String filter, int skip); int countByFilter(String filter); int countUsers(String filter); Iterator<User> getAllUsers();  }
@Test public void getUserSearches () { List<Search> s = dao.getUserSearches (dao.read ("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0")); Assert.assertEquals (s.size (), 2); }