### Question:
TaskAssignmentResourceFacadeImp extends CoreDBServiceFacadeImp<TaskAssignment, Long> implements TaskAssignmentResourceFacade { @Override public int undoTaskAssignment(List<DocumentDTO> taskList, Long userID) { if (taskList != null && !taskList.isEmpty()) { try { int deleteCount = 0; for (Iterator<DocumentDTO> it = taskList.iterator(); it.hasNext();){ DocumentDTO tb = (DocumentDTO) it.next(); TaskAssignment taskAssignment = (TaskAssignment) getTaskAssignment(tb.getDocumentID(), userID); delete(taskAssignment); em.flush(); ++deleteCount; } return deleteCount; } catch (Exception e) { logger.error("Error in undo operation!"); } } return 0; } TaskAssignmentResourceFacadeImp(); @Override int insertTaskAssignment(List<DocumentDTO> taskList, Long userID); @Override int insertOneTaskAssignment(Long documentID, Long userID); @Override int undoTaskAssignment(List<DocumentDTO> taskList, Long userID); @Override int undoTaskAssignment(Map<Long, Long> taskMap); @Override int undoTaskAssignment(Long documentID, Long userID); @Override void undoTaskAssignmentByTimer(); @Override TaskAssignmentDTO findTaskAssignment(Long documentID, Long userID); @Override List<TaskAssignmentDTO> findTaskAssignmentByID(Long documentID); @Override Integer getPendingTaskCount(Long userID);  }### Answer:
@Test public void testUndoTaskAssignmentByDocumentIdAndUserId() { entityManager.getTransaction().begin(); int result = taskAssignmentResourceFacadeImp.undoTaskAssignment(documentDTO.getDocumentID(), user.getUserID()); entityManager.getTransaction().commit(); assertEquals(1,result); taskAssignment=null; }
@Test public void testUndoTaskAssignmentByTaskMap() { Map<Long, Long> taskMap = new HashMap<Long, Long>(); taskMap.put(documentDTO.getDocumentID(), user.getUserID()); entityManager.getTransaction().begin(); int result = taskAssignmentResourceFacadeImp.undoTaskAssignment(taskMap); entityManager.getTransaction().commit(); assertEquals(1,result); taskAssignment=null; }
@Test public void testUndoTaskAssignmentByDocumentListAndUserId() { List<DocumentDTO> documentDTOs = new ArrayList<DocumentDTO>(); documentDTOs.add(documentDTO); entityManager.getTransaction().begin(); int result = taskAssignmentResourceFacadeImp.undoTaskAssignment(documentDTOs, user.getUserID()); entityManager.getTransaction().commit(); assertEquals(1,result); taskAssignment=null; }