DateRangeVisitor extends RangeVisitor { public void visit(Feature feature) { final Object firstValue = expr1.evaluate(feature); final Object secondValue = expr2.evaluate(feature); if (firstValue != null && secondValue != null) { final Date beginDate = (Date) firstValue; final Date endDate = (Date) secondValue; set.add(new DateRange(beginDate, endDate)); } } DateRangeVisitor(String attributeTypeName1, String attributeTypeName2); void visit(Feature feature);  }
@Test public void testSingleRange() throws ParseException { DateRangeVisitor visitor = new DateRangeVisitor("start", "end"); visitor.visit(buildRangeFeature("2008-10-31T00:00:00.000Z", "2008-11-01T00:00:00.000Z")); Set<String> range = visitor.getRange(); assertEquals(1, range.size()); assertEquals("2008-10-31T00:00:00.000Z/2008-11-01T00:00:00.000Z/PT1S", range.iterator().next()); }