// Path: apex/src/main/java/com/sixthsolution/apex/model/Event.java
// public class Event {
// 
//     private String title = "";
//     private String location = "";
//     private LocalDateTime startDateTime = null;
//     private LocalDateTime endDateTime = null;
//     private boolean isAllDay = false;
//     private Recurrence recurrence = null;
// 
//     public Event() {
// 
//     }
// 
//     public Event(String title, String location, LocalDateTime startDateTime,
//                  LocalDateTime endDateTime,
//                  boolean isAllDay, Recurrence recurrence) {
//         this.title = title;
//         this.location = location;
//         this.startDateTime = startDateTime;
//         this.endDateTime = endDateTime;
//         this.isAllDay = isAllDay;
//         this.recurrence = recurrence;
//     }
// 
// 
//     public void setTitle(String title) {
//         this.title = title;
//     }
// 
//     public void setStartDateTime(LocalDateTime startDateTime) {
//         this.startDateTime = startDateTime;
//     }
// 
//     public void setEndDateTime(LocalDateTime endDateTime) {
//         this.endDateTime = endDateTime;
//     }
// 
//     public String title() {
//         return title;
//     }
// 
//     public String location() {
//         return location;
//     }
// 
//     public LocalDateTime start() {
//         return startDateTime;
//     }
// 
//     public LocalDateTime end() {
//         return endDateTime;
//     }
// 
//     public boolean isAllDay() {
//         return isAllDay;
//     }
// 
//     public void setAllDay(boolean allDay) {
//         isAllDay = allDay;
//     }
// 
//     public boolean isRecurrence() {
//         return recurrence != null;
//     }
// 
//     public void setRecurrence(Recurrence recurrence) {
//         this.recurrence = recurrence;
//     }
// 
//     public Recurrence recurrence() {
//         return recurrence;
//     }
// 
// 
//     @Override
//     public String toString() {
//         return "Event{" +
//                 "title='" + title + '\'' +
//                 ", startDateTime=" + startDateTime +
//                 ", endDateTime=" + endDateTime +
//                 ", isAllDay=" + isAllDay +
//                 ", recurrence=" + recurrence +
//                 '}';
//     }
// 
// }
// 
// Path: apex/src/main/java/com/sixthsolution/apex/model/Recurrence.java
// public class Recurrence {
// 
//     private Frequency frequency = Frequency.DAILY;
// 
//     /**
//      * Specifies how often the event should be repeated.
//      */
//     private int interval = 1;
// 
//     /**
//      * The date or date-time until which the event should be repeated.
//      */
//     private LocalDateTime until = null;
// 
//     private boolean forever = false;
//     /**
//      * Days of the week on which the event should be repeated
//      */
//     private List<WeekDay> byDays;
// 
//     public Recurrence(Frequency frequency, int interval, LocalDateTime until, boolean forever,
//                       List<WeekDay> byDays) {
//         this.frequency = frequency;
//         this.interval = interval;
//         this.until = until;
//         this.forever = forever;
//         this.byDays = byDays;
//     }
// 
//     public Frequency frequency() {
//         return frequency;
//     }
// 
//     public int interval() {
//         return interval;
//     }
// 
//     //TODO @nullable
//     public LocalDateTime until() {
//         return until;
//     }
// 
//     public boolean isForever() {
//         return forever;
//     }
// 
//     public List<WeekDay> byDays() {
//         return byDays;
//     }
// 
//     @Override
//     public String toString() {
//         return "Recurrence{" +
//                 "frequency=" + frequency +
//                 ", interval=" + interval +
//                 ", until=" + until +
//                 ", forever=" + forever +
//                 ", byDays=" + byDays +
//                 '}';
//     }
// }
// 
// Path: apex/src/main/java/com/sixthsolution/apex/nlp/parser/Parser.java
// public interface Parser {
// 
//     void initialize();
// 
//     Event parse(LocalDateTime source, String sentence);
// }


import com.sixthsolution.apex.model.Event;
import com.sixthsolution.apex.model.Recurrence;
import com.sixthsolution.apex.nlp.parser.Parser;
import org.threeten.bp.LocalDate;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.LocalTime;
import org.threeten.bp.format.DateTimeFormatter;
import java.util.ArrayList;
import static org.junit.Assert.assertEquals;
            return this;
        }

        private void assertDateTime(LocalDateTime actual, String expectedAsString) {
            LocalDateTime expected = LocalDateTime.parse(expectedAsString, formatter);
            assertEquals(expected.getYear(), actual.getYear());
            assertEquals(expected.getDayOfMonth(), actual.getDayOfMonth());
            assertEquals(expected.getMonthValue(), actual.getMonthValue());
            assertEquals(expected.getHour(), actual.getHour());
            assertEquals(expected.getMinute(), actual.getMinute());
        }

        public EventAssertion checkRecurrence(String expected){
            assertRecurrence(event.recurrence(),expected);
            return this;
        }

        private void assertRecurrence(Recurrence actual,String expected){
            String[] e=expected.toLowerCase().split(",");
            assertEquals(e[0], actual.frequency().toString().toLowerCase());
            assertEquals(e[1], String.valueOf(actual.interval()));
            assertEquals(e[2],String.valueOf(actual.isForever()));
            assertEquals(e[3],String.valueOf(actual.until().toLocalDate()));

        }
        public EventAssertion startTime(String expectedAsString) {
            assertTime(event.start().toLocalTime(), expectedAsString);
            return this;
        }

// Path: apex/src/main/java/com/sixthsolution/apex/model/Event.java
// public class Event {
// 
//     private String title = "";
//     private String location = "";
//     private LocalDateTime startDateTime = null;
//     private LocalDateTime endDateTime = null;
//     private boolean isAllDay = false;
//     private Recurrence recurrence = null;
// 
//     public Event() {
// 
//     }
// 
//     public Event(String title, String location, LocalDateTime startDateTime,
//                  LocalDateTime endDateTime,
//                  boolean isAllDay, Recurrence recurrence) {
//         this.title = title;
//         this.location = location;
//         this.startDateTime = startDateTime;
//         this.endDateTime = endDateTime;
//         this.isAllDay = isAllDay;
//         this.recurrence = recurrence;
//     }
// 
// 
//     public void setTitle(String title) {
//         this.title = title;
//     }
// 
//     public void setStartDateTime(LocalDateTime startDateTime) {
//         this.startDateTime = startDateTime;
//     }
// 
//     public void setEndDateTime(LocalDateTime endDateTime) {
//         this.endDateTime = endDateTime;
//     }
// 
//     public String title() {
//         return title;
//     }
// 
//     public String location() {
//         return location;
//     }
// 
//     public LocalDateTime start() {
//         return startDateTime;
//     }
// 
//     public LocalDateTime end() {
//         return endDateTime;
//     }
// 
//     public boolean isAllDay() {
//         return isAllDay;
//     }
// 
//     public void setAllDay(boolean allDay) {
//         isAllDay = allDay;
//     }
// 
//     public boolean isRecurrence() {
//         return recurrence != null;
//     }
// 
//     public void setRecurrence(Recurrence recurrence) {
//         this.recurrence = recurrence;
//     }
// 
//     public Recurrence recurrence() {
//         return recurrence;
//     }
// 
// 
//     @Override
//     public String toString() {
//         return "Event{" +
//                 "title='" + title + '\'' +
//                 ", startDateTime=" + startDateTime +
//                 ", endDateTime=" + endDateTime +
//                 ", isAllDay=" + isAllDay +
//                 ", recurrence=" + recurrence +
//                 '}';
//     }
// 
// }
// 
// Path: apex/src/main/java/com/sixthsolution/apex/model/Recurrence.java
// public class Recurrence {
// 
//     private Frequency frequency = Frequency.DAILY;
// 
//     /**
//      * Specifies how often the event should be repeated.
//      */
//     private int interval = 1;
// 
//     /**
//      * The date or date-time until which the event should be repeated.
//      */
//     private LocalDateTime until = null;
// 
//     private boolean forever = false;
//     /**
//      * Days of the week on which the event should be repeated
//      */
//     private List<WeekDay> byDays;
// 
//     public Recurrence(Frequency frequency, int interval, LocalDateTime until, boolean forever,
//                       List<WeekDay> byDays) {
//         this.frequency = frequency;
//         this.interval = interval;
//         this.until = until;
//         this.forever = forever;
//         this.byDays = byDays;
//     }
// 
//     public Frequency frequency() {
//         return frequency;
//     }
// 
//     public int interval() {
//         return interval;
//     }
// 
//     //TODO @nullable
//     public LocalDateTime until() {
//         return until;
//     }
// 
//     public boolean isForever() {
//         return forever;
//     }
// 
//     public List<WeekDay> byDays() {
//         return byDays;
//     }
// 
//     @Override
//     public String toString() {
//         return "Recurrence{" +
//                 "frequency=" + frequency +
//                 ", interval=" + interval +
//                 ", until=" + until +
//                 ", forever=" + forever +
//                 ", byDays=" + byDays +
//                 '}';
//     }
// }
// 
// Path: apex/src/main/java/com/sixthsolution/apex/nlp/parser/Parser.java
// public interface Parser {
// 
//     void initialize();
// 
//     Event parse(LocalDateTime source, String sentence);
// }


// Path: apex/src/test/java/com/sixthsolution/apex/nlp/test/ParserAssertion.java
import com.sixthsolution.apex.model.Event;
import com.sixthsolution.apex.model.Recurrence;
import com.sixthsolution.apex.nlp.parser.Parser;
import org.threeten.bp.LocalDate;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.LocalTime;
import org.threeten.bp.format.DateTimeFormatter;
import java.util.ArrayList;
import static org.junit.Assert.assertEquals;

            return this;
        }

        private void assertDateTime(LocalDateTime actual, String expectedAsString) {
            LocalDateTime expected = LocalDateTime.parse(expectedAsString, formatter);
            assertEquals(expected.getYear(), actual.getYear());
            assertEquals(expected.getDayOfMonth(), actual.getDayOfMonth());
            assertEquals(expected.getMonthValue(), actual.getMonthValue());
            assertEquals(expected.getHour(), actual.getHour());
            assertEquals(expected.getMinute(), actual.getMinute());
        }

        public EventAssertion checkRecurrence(String expected){
            assertRecurrence(event.recurrence(),expected);
            return this;
        }

        private void assertRecurrence(Recurrence actual,String expected){
            String[] e=expected.toLowerCase().split(",");
            assertEquals(e[0], actual.frequency().toString().toLowerCase());
            assertEquals(e[1], String.valueOf(actual.interval()));
            assertEquals(e[2],String.valueOf(actual.isForever()));
            assertEquals(e[3],String.valueOf(actual.until().toLocalDate()));

        }
        public EventAssertion startTime(String expectedAsString) {
            assertTime(event.start().toLocalTime(), expectedAsString);
            return this;
        }

        public EventAssertion endTime(String expectedAsString) {