### Question:
UserBanner { public void banUsers(UserList usersToBan) { Group bannedUserGroup = getBannedUsersGroups().get(0); bannedUserGroup.getUsers().addAll(usersToBan.getUsers()); groupDao.saveOrUpdate(bannedUserGroup); } 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 testBanUsers(Group bannedUsersGroup) throws Exception { doReturn(Arrays.asList(bannedUsersGroup)).when(groupDao).getByName("Banned Users"); PoulpeUser bannedUser = new PoulpeUser("c", "c", "c", "c"); sut.banUsers(new UserList(Arrays.asList(bannedUser))); assertTrue(bannedUsersGroup.getUsers().contains(bannedUser)); verify(groupDao).saveOrUpdate(bannedUsersGroup); }