Date sTime = DateUtilities.parseISO("2005-05-19T20:32:56Z");
Date eTime = DateUtilities.parseISO("2005-05-20T20:32:56Z");
Filter filter = CQL
.toFilter("not (when before 2005-05-20T20:32:56Z and when after 2005-05-19T20:32:56Z)");
Query query = new Query("type", filter);
TemporalConstraints range = (TemporalConstraints) query.getFilter()
.accept(visitor, null);
assertNotNull(range);
assertEquals(TemporalRange.START_TIME, range.getStartRange()
.getStartTime());
assertEquals(new Date(sTime.getTime() - 1), range.getStartRange()
.getEndTime());
assertEquals(eTime, range.getRanges().get(1).getStartTime());
assertEquals(TemporalRange.END_TIME, range.getRanges().get(1)
.getEndTime());
}