@@ -0,0 +1,1376 @@
+package ems.service;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Date;%0Aimport java.util.Iterator;%0Aimport java.util.List;%0A%0Aimport org.springframework.stereotype.Service;%0A%0Aimport ems.model.Todo;%0A%0A@Service%0Aclass TodoService %7B%0A    private static List%3CTodo%3E todos = new ArrayList%3CTodo%3E();%0A    private static int todoCount = 3;%0A%0A    static %7B%0A        todos.add(new Todo(1, %22in28minutes%22, %22Learn Spring MVC%22, new Date(), false));%0A        todos.add(new Todo(2, %22in28minutes%22, %22Learn Strut%22, new Date(), false));%0A        todos.add(new Todo(3, %22in28minutes%22, %22Learn Hibernate%22, new Date(), false));%0A    %7D%0A%0A    public List%3CTodo%3E retrieveTodos(String user) %7B%0A        List%3CTodo%3E resultList = new ArrayList%3CTodo%3E();%0A        if (user != null) %7B%0A            for (Todo todo : todos) %7B%0A                if (user.equals(todo.getUser())) %7B%0A                    resultList.add(todo);%0A                %7D%0A            %7D%0A        %7D%0A        return resultList;%0A    %7D%0A%0A    public void addTodo(String name, String desc, Date targetDate, boolean isDone) %7B%0A        todos.add(new Todo(++todoCount, desc, name, targetDate, isDone));%0A    %7D%0A%0A    public void deleteTodo(int id) %7B%0A        Iterator%3CTodo%3E iterator = todos.iterator();%0A        while (iterator.hasNext()) %7B%0A            Todo todo = iterator.next();%0A            if (todo.getId() == id) %7B%0A                iterator.remove();%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add Todo service