### Question:
UserBanner { public List<PoulpeUser> getAllBannedUsers() { List<Group> bannedUserGroups = getBannedUsersGroups(); return userDao.getUsersInGroups(bannedUserGroups); } UserBanner(GroupDao groupDao, UserDao userDao); List<PoulpeUser> getAllBannedUsers(); List<PoulpeUser> getNonBannedUsersByUsername(String availableFilterText, Pagination pagination); void banUsers(UserList usersToBan); void revokeBan(UserList usersToRevoke); List<Group> getBannedUsersGroups(); static final String BANNED_USERS_GROUP_NAME; }### Answer:
@Test(dataProvider = "provideGroupWithUsers") public void getAllBannedUsers(Group bannedUsersGroup) throws Exception { doReturn(Arrays.asList(bannedUsersGroup)).when(groupDao).getByNameContains("Banned Users"); doReturn(bannedUsersGroup.getUsers()).when(userDao).getUsersInGroups(Arrays.asList(bannedUsersGroup)); assertEquals(bannedUsersGroup.getUsers(), userDao.getUsersInGroups(Arrays.asList(bannedUsersGroup))); }