### Question:
RoleManagerServiceImpl extends HibernateDaoImpl implements RoleManagerService { @Transactional(propagation = Propagation.REQUIRED, readOnly = false) public void deleteAll(ExecutionContext context, List<String> roles) { if (roles != null) { for(String roleName : roles) { if (roleName != null && roleName.length() > 0) { userService.deleteRole(context, roleName); } } } }  void setTransactionManager(AbstractPlatformTransactionManager transactionManager); void setUserService(UserAuthorityService userService); PaginatedOperationResult getUsersWithoutRole(final ExecutionContext context, final String roleName, final String userName,
                                    Set assignedUserNameSet, Set unassignedUserNameSet,
                                    int firstResult, int maxResults); PaginatedOperationResult getUsersWithRole(final ExecutionContext context, final String roleName, final String userName,
                                 Set assignedUserNameSet, Set unassignedUserNameSet,
                                 int firstResult, int maxResults); @Transactional(propagation = Propagation.REQUIRED, readOnly = false) void updateRole(ExecutionContext context, String roleName, Role roleDetails, Set<User> assignedUserSet,
            Set<User> unassignedUserSet); @Transactional(propagation = Propagation.REQUIRED, readOnly = false) void deleteAll(ExecutionContext context, List<String> roles);  }### Answer:
@Test public void deleteAll() { List<String> roles = new ArrayList<String>(); roles.add(demo); roles.add(first); roles.add(second); managerService.deleteAll(null, roles); verify(userService, times(1)).deleteRole(null, demo); verify(userService, times(1)).deleteRole(null, first); verify(userService, times(1)).deleteRole(null, second); }
@Test public void deleteAllIfNull() { managerService.deleteAll(null, null); }
@Test public void deleteAllIfEmptyList() { managerService.deleteAll(null, new ArrayList<String>()); }
@Test public void deleteAllIfListWithNullAndEmptyValue() { List<String> roles = new ArrayList<String>(); roles.add(null); roles.add(""); managerService.deleteAll(null, roles); }