### Question:
TaskManager extends AbstractMongoManager { public Collection<TaskPojo> acquireTodoTasks(User user) { Collection<TaskPojo> tasks = acquireTasks(user, getTodoSetName(user)); logger.debug("User's todo task's number is {} ", tasks.size()); return tasks; } TaskManager(); static TaskManager getInstance(); void reload(); TaskPojo getTaskById(String id); void setTaskById(TaskPojo task); Collection<TaskPojo> getTasks(); Collection<TaskPojo> assignNewTask(TaskType type, User user); List<TaskPojo> assignNewTask(TaskType type, User user, 
			int maxCount); List<TaskPojo> assignNewTask(TaskType type, User user, 
			int maxCount, boolean sendAddTask); boolean checkTaskAvailable(User user, TaskPojo task); Collection<TaskPojo> getUserLoginTasks(User user); ArrayList<String> getAllUnlockedAchievements(User user); boolean refreshDailyTask(User user); boolean storeTaskSpecificData(User user, String taskId, Field field, Object data); String queryTaskSpecificData(User user, String taskId, Field field); boolean deleteTaskData(User user, String taskId); void processUserTasks(User user, TaskHook taskHook, Object ... parameters ); static final String getTaskDataKey(User user, Field field); Collection<TaskPojo> acquireTodoTasks(User user); Collection<TaskPojo> acquireFinishedTasks(User user); Collection<TaskPojo> acquireAwardedTasks(User user, TaskType taskType); boolean finishTask(User user, String taskId); boolean isTaskRewardTaken(User user, String taskId); boolean isTaskRewardFinished(User user, String taskId); boolean takeTaskReward(User user, String taskId, int choose); void deleteUserTasks(User user); Collection<TaskPojo> acquireTasks(User user, String setName); Collection<TaskPojo> acquireUserLevelUpTasks(User user,
			Set<String> todoTaskIdSet, Set<String> finishTaskIdSet, 
			Set<String> awardTaskIdSet); TreeSet<TaskPojo> getTasksForType(TaskType type); static final String getFinishedSetName(User user); static final String getTodoSetName(User user); static final String getAwardedSetName(User user); BseTask toBseTask(User user); XinqiBseTaskList.TaskProtoInfo toTaskProtoInfo(User user, TaskPojo task); BseAchievements toBseAchievement(); void sendBseUserAchievements(User user); BseZip toBseZip();  }### Answer:
@Test public void testAcquireTodoTasks() { TaskManager manager = TaskManager.getInstance(); User user = UserManager.getInstance().createDefaultUser(); user.setLevel(4); Collection<TaskPojo> expected = user.getTasks(TaskType.TASK_MAIN); int actCount = user.getTasks(TaskType.TASK_ACTIVITY).size(); int dailyCount = user.getTasks(TaskType.TASK_DAILY).size(); HashSet<String> scripts = new HashSet<String>(); for ( TaskPojo task : expected ) { assertTrue(!scripts.contains(task.getScript())); scripts.add(task.getScript()); } System.out.println(expected); Collection<TaskPojo> actual = manager.acquireTodoTasks(user); System.out.println(actual); assertEquals(expected.size()+actCount+dailyCount, actual.size()); }