package seedu.taskitty.testutil;

import java.util.ArrayList;
import java.util.logging.Logger;

import guitests.guihandles.TaskListPanelHandle;
import seedu.taskitty.commons.core.LogsCenter;
import seedu.taskitty.model.task.Task;

public class TestTaskList {
    private ArrayList<TestTask> todoList;
    private ArrayList<TestTask> deadlineList;
    private ArrayList<TestTask> eventList;
    
    private final Logger logger = LogsCenter.getLogger(TestTaskList.class);
    
    public TestTaskList(TestTask[] taskList) {
        clear();
        splitTaskList(taskList);
    }
    
    private void splitTaskList(TestTask[] taskList) {
        for (TestTask task : taskList) {
            addTaskToList(task);
        }
    }
    
    public void addTaskToList(TestTask task) {
        switch (task.getNumArgs()) {
        
        case Task.TASK_COMPONENT_COUNT :
            todoList.add(task);
            break;
            
        case Task.DEADLINE_COMPONENT_COUNT :
            deadlineList.add(task);
            break;
            
        case Task.EVENT_COMPONENT_COUNT :
            eventList.add(task);
            break;
            
        default :
            logger.warning("Task did not fit in any list");
        }
    }
    
    public void clear() {
        todoList = new ArrayList<TestTask>();
        deadlineList = new ArrayList<TestTask>();
        eventList = new ArrayList<TestTask>();
    }
    
    public boolean isListMatching(TaskListPanelHandle taskListPanel) {
        return taskListPanel.isTodoListMatching(todoList.toArray(new TestTask[todoList.size()]))
        && taskListPanel.isDeadlineListMatching(deadlineList.toArray(new TestTask[deadlineList.size()]))
        && taskListPanel.isEventListMatching(eventList.toArray(new TestTask[eventList.size()]));
    }

}

@@ -76,24 +76,98 @@
 til.
-logging.Logger;%0A
+List;%0Aimport java.util.logging.Logger;%0A%0Aimport edu.emory.mathcs.backport.java.util.Arrays;
 %0Aimp
@@ -330,37 +330,32 @@
 t %7B%0A    private 
-Array
 List%3CTestTask%3E t
@@ -367,37 +367,32 @@
 st;%0A    private 
-Array
 List%3CTestTask%3E d
@@ -416,21 +416,16 @@
 private 
-Array
 List%3CTes
@@ -632,24 +632,361 @@
 %0A    %7D%0A    %0A
+    public TestTaskList(TestTask%5B%5D todoList, TestTask%5B%5D deadlineList, TestTask%5B%5D eventList) %7B%0A        this.todoList = new ArrayList%3CTestTask%3E(Arrays.asList(todoList));%0A        this.deadlineList = new ArrayList%3CTestTask%3E(Arrays.asList(deadlineList));%0A        this.eventList = new ArrayList%3CTestTask%3E(Arrays.asList(eventList));%0A    %7D%0A    %0A
     private 
@@ -1631,32 +1631,104 @@
    %7D%0A    %7D%0A    %0A
+    public void removeTaskFromList(TestTask task) %7B%0A        %0A    %7D%0A    %0A
     public void 
@@ -1883,32 +1883,298 @@
 %3E();%0A    %7D%0A    %0A
+    public TestTaskList copy() %7B%0A        return new TestTaskList(todoList.toArray(new TestTask%5BtodoList.size()%5D),%0A                deadlineList.toArray(new TestTask%5BdeadlineList.size()%5D),%0A                eventList.toArray(new TestTask%5BeventList.size()%5D));%0A    %7D%0A    %0A
     public boole

Add copy method