KeywordsSearcher { public KeywordBean searchById(String id, String sThesaurusName, String... languages) { KeywordBean result = null; Thesaurus thesaurus = _thesaurusFinder.getThesaurusByName(sThesaurusName); try { result = thesaurus.getKeyword(id, languages); } catch (Exception e) { } return result; } KeywordsSearcher(IsoLanguagesMapper mapper, ThesaurusFinder thesaurusFinder);  KeywordsSearcher(ServiceContext context, ThesaurusFinder thesaurusFinder); static Element toRawElement(Element rootEl, KeywordBean kb); KeywordBean searchById(String id, String sThesaurusName, String... languages); void searchTopConcepts(String sThesaurusName, String... languages); void search(KeywordSearchParams params); void search(String contextLanguage, Element params); void search(String contextLanguage, Element params, Comparator<KeywordBean> comparator); void searchForRelated(Element params, KeywordRelation request, @Nullable Comparator<KeywordBean> comparator,
                                 String... languages); void searchForRelated(String id, String sThesaurusName, KeywordRelation request, @Nullable Comparator<KeywordBean> comparator,
                                 String... languages); int getNbResults(); List<KeywordBean> getResults(); Element getXmlResults(); void selectUnselectKeywords(Element params); void selectUnselectKeywords(Set<String> idSet); void clearSelection(); Element getSelectedKeywordsAsXml(); List<KeywordBean> getSelectedKeywordsInList(); KeywordBean getKeywordFromResultsById(int id); KeywordBean getKeywordFromResultsById(String id); KeywordBean getKeywordFromResultsByUriCode(String code);  }
@Test public void testSearchByIdStringStringString() throws Exception { KeywordsSearcher searcher = new KeywordsSearcher(isoLangMapper, thesaurusFinder); KeywordBean kw = searcher.searchById(FOO_COM_NS + "4", thesaurusFoo.getKey(), "eng"); assertNotNull(kw); assertEquals(createFooLabel(4, "eng"), kw.getDefaultValue()); assertEquals(createFooNote(4, "eng"), kw.getDefaultDefinition()); kw = searcher.searchById(BLAH_COM_NS + "4", thesaurusBlah.getKey(), "eng", "fre", "ita", "ger", "chi"); assertEquals(createBlahLabel(4, "eng"), kw.getDefaultValue()); assertEquals(createBlahNote(4, "eng"), kw.getDefaultDefinition()); assertEquals("eng", kw.getDefaultLang()); assertNotNull(kw); assertEquals(createBlahLabel(4, "fre"), kw.getValues().get("fre")); assertEquals(createBlahNote(4, "ger"), kw.getDefinitions().get("ger")); assertEquals(createBlahLabel(4, "ita"), kw.getValues().get("ita")); assertEquals(createBlahNote(4, "eng"), kw.getDefinitions().get("eng")); assertEquals("", kw.getDefinitions().get("chi")); kw = searcher.searchById(FOO_COM_NS + "4", thesaurusBlah.getKey(), "eng"); assertNull(kw); }