String formatStart = dateFormat.format(start.toDate());
String formatEnd = dateFormat.format(end.toDate());
builder = builder.fields("Id", "Name", "Status").forDateRange(start, end);
Selector selector = builder.build();
Assert.assertEquals(selector.getDateRange().getMin(), formatStart);
Assert.assertEquals(selector.getDateRange().getMax(), formatEnd);
String formatEndPlusOne = dateFormat.format(end.plusDays(1).toDate());
DateRange dateRange = new DateRange();
dateRange.setMin(formatStart);
dateRange.setMax(formatEndPlusOne);
selector.setDateRange(dateRange);
Assert.assertEquals(selector.getDateRange().getMin(), formatStart);
Assert.assertEquals(selector.getDateRange().getMax(), formatEndPlusOne);
Selector selectorRebuilt =
builder.fields("Id", "Name", "Status").forDateRange(start, end).build();
Assert.assertEquals(selectorRebuilt.getDateRange().getMin(), formatStart);
Assert.assertEquals(selectorRebuilt.getDateRange().getMax(), formatEnd);
}