@Test public void testCompare() throws Exception { Event rhsEvent = mock(Event.class); Event lhsEvent = mock(Event.class); DateTimeComparator dateTimeComparator = DateTimeComparator.getInstance(); DateTime rhsDateTime = new DateTime(2017, 1, 20, 0, 0, 0, 0); DateTime lhsDateTime = new DateTime(2017, 1, 21, 0, 0, 0, 0); when(rhsEvent.getTime()).thenReturn(rhsDateTime); when(lhsEvent.getTime()).thenReturn(lhsDateTime); assertEquals(dateTimeComparator.compare(lhsEvent.getTime(), rhsEvent.getTime()), presenter.compare(lhsEvent, rhsEvent)); rhsDateTime = new DateTime(2017, 1, 21, 0, 0, 0, 0); lhsDateTime = new DateTime(2017, 1, 20, 0, 0, 0, 0); when(rhsEvent.getTime()).thenReturn(rhsDateTime); when(lhsEvent.getTime()).thenReturn(lhsDateTime); assertEquals(dateTimeComparator.compare(lhsEvent.getTime(), rhsEvent.getTime()), presenter.compare(lhsEvent, rhsEvent)); }
@Override public int compare(Event lhs, Event rhs) { return DateTimeComparator.getInstance().compare(lhs.getTime(), rhs.getTime()); }
SchedulePresenter extends RxPresenter<ScheduleView, ArrayList<Event>> implements Comparator<Event> { @Override public int compare(Event lhs, Event rhs) { return DateTimeComparator.getInstance().compare(lhs.getTime(), rhs.getTime()); } }
SchedulePresenter extends RxPresenter<ScheduleView, ArrayList<Event>> implements Comparator<Event> { @Override public int compare(Event lhs, Event rhs) { return DateTimeComparator.getInstance().compare(lhs.getTime(), rhs.getTime()); }  }
SchedulePresenter extends RxPresenter<ScheduleView, ArrayList<Event>> implements Comparator<Event> { @Override public int compare(Event lhs, Event rhs) { return DateTimeComparator.getInstance().compare(lhs.getTime(), rhs.getTime()); }  void updateEvents(); @Override int compare(Event lhs, Event rhs); }
SchedulePresenter extends RxPresenter<ScheduleView, ArrayList<Event>> implements Comparator<Event> { @Override public int compare(Event lhs, Event rhs) { return DateTimeComparator.getInstance().compare(lhs.getTime(), rhs.getTime()); }  void updateEvents(); @Override int compare(Event lhs, Event rhs);  }