SuggestionsPortletDisplayBuilder { protected void buildSpellCheckSuggestion( SuggestionsPortletDisplayContext suggestionsPortletDisplayContext) { if (!_spellCheckSuggestionEnabled) { return; } suggestionsPortletDisplayContext.setSpellCheckSuggestionEnabled(true); SuggestionDisplayContext suggestionDisplayContext = _buildSuggestionDisplayContext(_spellCheckSuggestion); if (suggestionDisplayContext == null) { return; } suggestionsPortletDisplayContext.setHasSpellCheckSuggestion(true); suggestionsPortletDisplayContext.setSpellCheckSuggestion( suggestionDisplayContext); } SuggestionsPortletDisplayBuilder(Html html, Http http); SuggestionsPortletDisplayContext build(); void setKeywords(String keywords); void setKeywordsParameterName(String keywordsParameterName); void setRelatedQueriesSuggestions(
		List<String> relatedQueriesSuggestions); void setRelatedQueriesSuggestionsEnabled(
		boolean relatedQueriesSuggestionsEnabled); void setSearchURL(String searchURL); void setSpellCheckSuggestion(String spellCheckSuggestion); void setSpellCheckSuggestionEnabled(
		boolean spellCheckSuggestionEnabled);  }
@Test public void testGetSpellCheckSuggestion() { SuggestionDisplayContext suggestionDisplayContext = buildSpellCheckSuggestion("alpha"); assertSuggestion("[alpha] | q=X(q<<alpha)", suggestionDisplayContext); }
@Test public void testGetSpellCheckSuggestionEqualsToKeywords() { setUpSearchedKeywords("q", "a b"); Assert.assertNull(buildSpellCheckSuggestion("a b")); }
@Test public void testGetSpellCheckSuggestionFormatted() { setUpSearchedKeywords("q", "a b"); SuggestionDisplayContext suggestionDisplayContext = buildSpellCheckSuggestion("a C"); assertSuggestion("a [C] | q=a b(q<<a C)", suggestionDisplayContext); }
@Test public void testGetSpellCheckSuggestionWithEmptySuggestion() { setUpSearchedKeywords("q", "a b"); Assert.assertNull(buildSpellCheckSuggestion("")); }
@Test public void testGetSpellCheckSuggestionWithNullSuggestion() { setUpSearchedKeywords("q", "a b"); Assert.assertNull(buildSpellCheckSuggestion(null)); }