DateRangeFactory { public String getRangeString(String label, Calendar calendar) { return replaceAliases(_rangeMap.get(label), calendar); } DateRangeFactory(DateFormatFactory dateFormatFactory); String getRangeString(String label, Calendar calendar); String getRangeString(String from, String to); Map<String, String> getRangeStrings(Calendar calendar); JSONArray replaceAliases(
		JSONArray rangesJSONArray, Calendar calendar, JSONFactory jsonFactory); String replaceAliases(String rangeString, Calendar calendar); void validateRange(String ranges);  }
@Test public void testBoundedRange() { Assert.assertEquals( "[20180131000000 TO 20180228235959]", _dateRangeFactory.getRangeString("2018-01-31", "2018-02-28")); }
@Test public void testNamedRange() { Calendar calendar = new GregorianCalendar( 2018, Calendar.MARCH, 1, 16, 30, 42); Assert.assertEquals( "[20180301153042 TO 20180301163042]", _dateRangeFactory.getRangeString("past-hour", calendar)); Assert.assertEquals( "[20180228163042 TO 20180301163042]", _dateRangeFactory.getRangeString("past-24-hours", calendar)); }