ModifiedFacetCalendarDisplayBuilder { public ModifiedFacetCalendarDisplayContext build() { buildBounds(); ModifiedFacetCalendarDisplayContext modifiedFacetCalendarDisplayContext = new ModifiedFacetCalendarDisplayContext(); Calendar fromCalendar = _getFromCalendar(); modifiedFacetCalendarDisplayContext.setFromDayValue( fromCalendar.get(Calendar.DATE)); modifiedFacetCalendarDisplayContext.setFromFirstDayOfWeek( fromCalendar.getFirstDayOfWeek() - 1); modifiedFacetCalendarDisplayContext.setFromMonthValue( fromCalendar.get(Calendar.MONTH)); modifiedFacetCalendarDisplayContext.setFromYearValue( fromCalendar.get(Calendar.YEAR)); Calendar toCalendar = _getToCalendar(); modifiedFacetCalendarDisplayContext.setToDayValue( toCalendar.get(Calendar.DATE)); modifiedFacetCalendarDisplayContext.setToFirstDayOfWeek( toCalendar.getFirstDayOfWeek() - 1); modifiedFacetCalendarDisplayContext.setToMonthValue( toCalendar.get(Calendar.MONTH)); modifiedFacetCalendarDisplayContext.setToYearValue( toCalendar.get(Calendar.YEAR)); modifiedFacetCalendarDisplayContext.setRangeBackwards( _isRangeBackwards(fromCalendar, toCalendar)); modifiedFacetCalendarDisplayContext.setSelected(_isSelected()); return modifiedFacetCalendarDisplayContext; } ModifiedFacetCalendarDisplayBuilder(
		CalendarFactory calendarFactory); ModifiedFacetCalendarDisplayContext build(); void setFrom(String from); void setLocale(Locale locale); void setRangeString(String rangeString); void setTimeZone(TimeZone timeZone); void setTo(String to);  }
@Test public void testDoNotBreakWithoutSettingValues() { ModifiedFacetCalendarDisplayBuilder modifiedFacetCalendarDisplayBuilder = createDisplayBuilder(); Assert.assertNotNull(modifiedFacetCalendarDisplayBuilder.build()); }
@Test public void testGetRangeFromCurrentDay() { TimeZone timeZone = TimeZoneUtil.getDefault(); ModifiedFacetCalendarDisplayBuilder modifiedFacetCalendarDisplayBuilder = createDisplayBuilder( timeZone); ModifiedFacetCalendarDisplayContext modifiedFacetCalendarDisplayContext = modifiedFacetCalendarDisplayBuilder.build(); Calendar todayCalendar = _calendarFactory.getCalendar(timeZone); Calendar yesterdayCalendar = (Calendar)todayCalendar.clone(); yesterdayCalendar.add(Calendar.DAY_OF_MONTH, -1); assertFromDateValues( yesterdayCalendar.get(Calendar.YEAR), yesterdayCalendar.get(Calendar.MONTH), yesterdayCalendar.get(Calendar.DAY_OF_MONTH), modifiedFacetCalendarDisplayContext); assertToDateValues( todayCalendar.get(Calendar.YEAR), todayCalendar.get(Calendar.MONTH), todayCalendar.get(Calendar.DAY_OF_MONTH), modifiedFacetCalendarDisplayContext); }