ModifiedFacetDisplayBuilder implements Serializable { public ModifiedFacetDisplayContext build() { ModifiedFacetDisplayContext modifiedFacetDisplayContext = new ModifiedFacetDisplayContext(); if (_calendarFactory != null) { modifiedFacetDisplayContext.setCalendarDisplayContext( buildCalendarDisplayContext()); } if ((_dateFormatFactory != null) && (_dateRangeFactory != null)) { modifiedFacetDisplayContext. setCustomRangeModifiedFacetTermDisplayContext( buildCustomRangeModifiedTermDisplayContext()); } modifiedFacetDisplayContext.setDefaultModifiedFacetTermDisplayContext( buildDefaultModifiedFacetTermDisplayContext()); modifiedFacetDisplayContext.setDisplayStyleGroupId( getDisplayStyleGroupId()); modifiedFacetDisplayContext. setModifiedFacetPortletInstanceConfiguration( _modifiedFacetPortletInstanceConfiguration); modifiedFacetDisplayContext.setModifiedFacetTermDisplayContexts( buildTermDisplayContexts()); modifiedFacetDisplayContext.setNothingSelected(isNothingSelected()); modifiedFacetDisplayContext.setPaginationStartParameterName( _paginationStartParameterName); modifiedFacetDisplayContext.setParameterName(_parameterName); modifiedFacetDisplayContext.setRenderNothing(isRenderNothing()); return modifiedFacetDisplayContext; } ModifiedFacetDisplayBuilder(
			CalendarFactory calendarFactory,
			DateFormatFactory dateFormatFactory, Http http,
			RenderRequest renderRequest); ModifiedFacetDisplayContext build(); void setCurrentURL(String currentURL); void setFacet(Facet facet); void setFromParameterValue(String from); void setLocale(Locale locale); void setPaginationStartParameterName(
		String paginationStartParameterName); void setParameterName(String parameterName); void setParameterValues(String... parameterValues); void setTimeZone(TimeZone timeZone); void setToParameterValue(String to); void setTotalHits(int totalHits);  }
@Test public void testModifiedFacetTermDisplayContexts() { ModifiedFacetDisplayBuilder modifiedFacetDisplayBuilder = createDisplayBuilder(); mockFacetConfiguration( "past-hour=[20180515225959 TO 20180515235959]", "some-time-ago=[20180508235959 TO 20180514235959]"); ModifiedFacetDisplayContext modifiedFacetDisplayContext = modifiedFacetDisplayBuilder.build(); List<ModifiedFacetTermDisplayContext> modifiedFacetTermDisplayContexts = modifiedFacetDisplayContext.getModifiedFacetTermDisplayContexts(); Assert.assertEquals( modifiedFacetTermDisplayContexts.toString(), 2, modifiedFacetTermDisplayContexts.size()); ModifiedFacetTermDisplayContext modifiedFacetTermDisplayContext = modifiedFacetTermDisplayContexts.get(0); Assert.assertEquals( "past-hour", modifiedFacetTermDisplayContext.getLabel()); Assert.assertEquals( "[20180515225959 TO 20180515235959]", modifiedFacetTermDisplayContext.getRange()); modifiedFacetTermDisplayContext = modifiedFacetTermDisplayContexts.get( 1); Assert.assertEquals( "some-time-ago", modifiedFacetTermDisplayContext.getLabel()); Assert.assertEquals( "[20180508235959 TO 20180514235959]", modifiedFacetTermDisplayContext.getRange()); }