### Question:
EventDateComparator implements Comparator<EventAdapter.Item> { @Override public int compare(EventAdapter.Item event1, EventAdapter.Item event2) { if (event1.getEvent().getStart() == null) { if (event2.getEvent().getStart() == null) { return 0; } else { return 1; } } else if (event2.getEvent().getStart() == null) { return -1; } else { return event1.getEvent().getStart().compareTo(event2.getEvent().getStart()); } }  @Override int compare(EventAdapter.Item event1, EventAdapter.Item event2); @Override boolean equals(Object obj);  }### Answer:
@Test public void valueAnEventHigherThanAnEventThatStartedBefore() { assertEquals(1, comparator.compare(eventInApril, eventInMarch)); assertEquals(-1, comparator.compare(eventInMarch, eventInApril)); assertEquals(0, comparator.compare(eventInMarch, eventInMarch)); }
@Test public void valueAnEventLowerThanAnEventWithoutStartDate() { assertEquals(-1, comparator.compare(eventInApril, eventWithoutStartDate)); assertEquals(1, comparator.compare(eventWithoutStartDate, eventInApril)); assertEquals(0, comparator.compare(eventWithoutStartDate, eventWithoutStartDate)); }