TimeBasedExcelRowComparator extends AbstractExcelRowComparator<ExcelRow<T>> { @Override public int compare(ExcelRow<T> lho, ExcelRow<T> rho) { return nullsLast(compareReferences( comparing(T::getDate, nullsLast(naturalOrder())) .thenComparing(T::getExpectedDepartureTime, nullsLast(naturalOrder())) .thenComparing(T::getExpectedArrivalTime, nullsLast(naturalOrder())) )).compare(lho, rho); }  @Override int compare(ExcelRow<T> lho, ExcelRow<T> rho);  }
@Test public final void testCompareNullDate() throws Exception { Assert.assertThat( comparator.compare( new ExcelRow.Builder(today, null).build(false), new BatchExcelRow.Builder(null, null).build(false) ), lessThan(0) ); }
@Test public final void testCompareNullOnLeft() throws Exception { Assert.assertThat( comparator.compare( null, new BatchExcelRow.Builder(null, null).build(false) ), greaterThan(0) ); }
@Test public final void testCompareNullOnRight() throws Exception { Assert.assertThat( comparator.compare( new ExcelRow.Builder(today, null).build(false), null ), lessThan(0) ); }
@Test public void testCompareNullExpectedDepartureTime() throws Exception { Assert.assertThat( comparator.compare( new ExcelRow.Builder(today, null).expectedDepartureTime(LocalTime.now()).build(false), new BatchExcelRow.Builder(today, null).build(false) ), lessThan(0) ); }
@Test public void testCompareNullExpectedArrivalTime() throws Exception { Assert.assertThat( comparator.compare( new ExcelRow.Builder(today, null) .expectedDepartureTime(now) .expectedArrivalTime(now) .build(false), new BatchExcelRow.Builder(today, null) .expectedDepartureTime(now) .build(false) ), lessThan(0) ); }