src/main/java/seedu/taskmanager/model/task/UniqueTaskList.java
/**
     * Marks the task in the list at position {@code index} as
     * {@code isComplete}.
     *
     * @throws DuplicateTaskException
     *             if updating the task's details causes the task to be
     *             equivalent to another existing task in the list.
     * @throws IndexOutOfBoundsException
     *             if {@code index} < 0 or >= the size of the list.
     * @throws NoSuchElementException
     *             if {@code isComplete} equals to task isMarkedAsComplete
     */
Marks the task in the list at position  index as
isComplete.

@throws DuplicateTaskException
if updating the task's details causes the task to be
equivalent to another existing task in the list.
@throws IndexOutOfBoundsException
if  index < 0 or >= the size of the list.
@throws NoSuchElementException
if  isComplete equals to task isMarkedAsComplete
Marks the task in the list at position index as isComplete . @throws DuplicateTaskException if updating the task ' s details causes the task to be equivalent to another existing task in the list . @throws IndexOutOfBoundsException if index < 0 or > = the size of the list . @throws NoSuchElementException if isComplete equals to task isMarkedAsComplete
public void markTask(int index, boolean isComplete) throws DuplicateTaskException {
        if (isComplete != internalList.get(index).getIsMarkedAsComplete()) {
            Task taskToMark = new Task(internalList.get(index).getTaskName(), internalList.get(index).getStartDate(),
                    internalList.get(index).getStartTime(), internalList.get(index).getEndDate(),
                    internalList.get(index).getEndTime(), internalList.get(index).getIsMarkedAsComplete(),
                    internalList.get(index).getCategories());
            taskToMark.setIsMarkedAsComplete(isComplete);
            if (!isComplete && internalList.contains(taskToMark)) {
                throw new DuplicateTaskException();
            }
            internalList.set(index, taskToMark);
        } else {
            throw new NoSuchElementException();
        }
    }
public void markTask ( int index , boolean isComplete ) throws DuplicateTaskException { if ( isComplete != internalList . get ( index ) . getIsMarkedAsComplete ( ) ) { Task taskToMark = new Task ( internalList . get ( index ) . getTaskName ( ) , internalList . get ( index ) . getStartDate ( ) , internalList . get ( index ) . getStartTime ( ) , internalList . get ( index ) . getEndDate ( ) , internalList . get ( index ) . getEndTime ( ) , internalList . get ( index ) . getIsMarkedAsComplete ( ) , internalList . get ( index ) . getCategories ( ) ) ; taskToMark . setIsMarkedAsComplete ( isComplete ) ; if ( ! isComplete && internalList . contains ( taskToMark ) ) { throw new DuplicateTaskException ( ) ; } internalList . set ( index , taskToMark ) ; } else { throw new NoSuchElementException ( ) ; } }
Marks the task in the list at position {@code index} as
 {@code isComplete}.
Marks the task in the list at position { @code index } as { @code isComplete } .