entityManager.flushAll();
final List<UserAchievement> lastEarnedAchievements = daoService.last(3);
assertEquals(lastEarnedAchievements.size(), 3);
final UserAchievement lastEarnedAchievement = lastEarnedAchievements.get(0);
assertEquals(lastEarnedAchievement.getUserWrapper(), patrick);
assertEquals(lastEarnedAchievement.getAchievement(), silverAchievement);
final UserAchievement penultimateAchievement = lastEarnedAchievements.get(1);
assertEquals(penultimateAchievement.getUserWrapper(), bob);
assertEquals(penultimateAchievement.getAchievement(), bronzeAchievement1);
}