ConceptPowerService implements IService { @Override public List<ISearchResult> search(String term) { List<ISearchResult> searchResults = new ArrayList<ISearchResult>(); ConceptpowerReply conceptReply = collectionManager.search(term, POS.NOUN); if(conceptReply!=null) { List<ConceptEntry> conceptEntries = conceptReply.getConceptEntry(); for(ConceptEntry ce : conceptEntries) { ISearchResult searchResult = new SearchResult(); searchResult.setName(ce.getLemma()); searchResult.setId(ce.getId()); searchResult.setDescription(ce.getDescription()); searchResults.add(searchResult); } } return searchResults; }  @Override String getServiceId(); @Override String getName(); @Override List<ISearchResult> search(String term);  }
@Test public void testSearch() { List<ISearchResult> expectedSearchResultList = new ArrayList<ISearchResult>(); ISearchResult searchResult = new SearchResult(); searchResult .setDescription("massive powerful herbivorous odd-toed ungulate of southeast Asia and" + "Africa having very thick skin and one or two horns on the snout"); searchResult.setId("WID-02391994-N-02-rhino"); searchResult.setName(rhino); expectedSearchResultList.add(searchResult); List<ISearchResult> searchResultList = conceptPowerService .search(rhino); assertEquals(expectedSearchResultList.size(), searchResultList.size()); }