package seedu.ezdo.commons.util;

import java.util.ArrayList;

import seedu.ezdo.commons.core.UnmodifiableObservableList;
import seedu.ezdo.model.todo.ReadOnlyTask;
//@@author A0139248X
/**
 * Utility methods for commands supporting multiple index
 */
public class MultipleIndexCommandUtil {
    /** checks if the indexes specified are all smaller than the size of the list and not 0 i.e. valid */
    public static boolean isIndexValid(UnmodifiableObservableList<ReadOnlyTask> lastShownList,
            ArrayList<Integer> targetIndexes) {
        return targetIndexes.stream().allMatch(index -> index <= lastShownList.size() && index != 0);
    }
}

@@ -158,16 +158,51 @@
 lyTask;%0A
+import seedu.ezdo.model.todo.Task;%0A
 //@@auth
@@ -320,16 +320,17 @@
 dUtil %7B%0A
+%0A
     /** 
@@ -570,16 +570,16 @@
 exes) %7B%0A
-
         
@@ -677,11 +677,902 @@
 );%0A    %7D
+%0A%0A    /** adds read only tasks from the unmodifiable observable list to the ArrayList list */%0A    public static void addReadOnlyTasksToList(ArrayList%3CReadOnlyTask%3E list,%0A            UnmodifiableObservableList%3CReadOnlyTask%3E lastShownList, ArrayList%3CInteger%3E targetIndexes) %7B%0A        for (int i = 0; i %3C targetIndexes.size(); i++) %7B%0A            ReadOnlyTask readOnlyTask = lastShownList.get(targetIndexes.get(i) - 1);%0A            list.add(readOnlyTask);%0A        %7D%0A    %7D%0A%0A    /** adds tasks from the unmodifiable observable list to the ArrayList list */%0A    public static void addTasksToList(ArrayList%3CTask%3E list,%0A            UnmodifiableObservableList%3CReadOnlyTask%3E lastShownList, ArrayList%3CInteger%3E targetIndexes) %7B%0A        for (int i = 0; i %3C targetIndexes.size(); i++) %7B%0A            Task task = (Task) lastShownList.get(targetIndexes.get(i) - 1);%0A            list.add(task);%0A        %7D%0A    %7D
 %0A%7D%0A

Add methods for adding tasks to a list to MultipleIndexCommandUtil