package werkbook.task.model.util;

import werkbook.task.commons.exceptions.IllegalValueException;
import werkbook.task.model.ReadOnlyTaskList;
import werkbook.task.model.TaskList;
import werkbook.task.model.tag.UniqueTagList;
import werkbook.task.model.task.Description;
import werkbook.task.model.task.EndDateTime;
import werkbook.task.model.task.Name;
import werkbook.task.model.task.StartDateTime;
import werkbook.task.model.task.Task;
import werkbook.task.model.task.UniqueTaskList;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class SampleDataUtil {
    public static Task[] getSampleTasks() {
    	Calendar cal = Calendar.getInstance();
    	SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HHmm");
        try {
            return new Task[] {
                new Task(new Name("Welcome to werkbook! Start by adding a task."),
                        new Description("Try: add <name of task> (description)"),
                        new StartDateTime("03/01/2016 0900"), new EndDateTime(sdf.format(cal.getTime())),
                        new UniqueTagList("Incomplete")),
                };
        } catch (IllegalValueException e) {
            throw new AssertionError("sample data cannot be invalid", e);
        }
    }

    public static ReadOnlyTaskList getSampleTaskList() {
        try {
            TaskList sampleTaskList = new TaskList();
            for (Task sampleTask : getSampleTasks()) {
                sampleTaskList.addTask(sampleTask);
            }
            return sampleTaskList;
        } catch (UniqueTaskList.DuplicateTaskException e) {
            throw new AssertionError("sample data cannot contain duplicate tasks", e);
        }
    }
}

@@ -28,16 +28,79 @@
 .util;%0A%0A
+import java.text.SimpleDateFormat;%0Aimport java.util.Calendar;%0A%0A
 import w
@@ -546,70 +546,8 @@
 ist;
-%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Calendar;
 %0A%0Apu
@@ -622,17 +622,20 @@
 ) %7B%0A    
-%09
+    
 Calendar
@@ -673,9 +673,12 @@
     
-%09
+    
 Simp
@@ -782,32 +782,16 @@
 Task%5B%5D %7B
-%0A               
  new Tas
@@ -866,28 +866,24 @@
             
- 
-   
 new Descript
@@ -924,28 +924,24 @@
 ription)%22),%0A
-    
             
@@ -1046,28 +1046,24 @@
             
-    
 new UniqueTa
@@ -1083,32 +1083,16 @@
 lete%22)),
-%0A               
  %7D;%0A    

Fix checkstyle errors