WikipediaCategoryResource extends AbstractResource { public Set<Entity> getEntity(String lexeme) throws LexicalSemanticResourceException { if (!containsLexeme(lexeme)) { return Collections.emptySet(); } Entity e = new Entity(lexeme); Set<Entity> eSet = new HashSet<Entity>(); eSet.add(e); return eSet; } WikipediaCategoryResource(DatabaseConfiguration dbConfig);  WikipediaCategoryResource(Wikipedia wiki);  WikipediaCategoryResource(String host, String database, String user, String password, Language language); boolean containsEntity(Entity entity); boolean containsLexeme(String lexeme); Set<Entity> getEntity(String lexeme); Set<Entity> getEntity(String lexeme, PoS pos); Set<Entity> getEntity(String lexeme, PoS pos, String sense); Set<Entity> getParents(Entity entity); int getNumberOfEntities(); Iterable<Entity> getEntities(); Set<Entity> getChildren(Entity entity); String getResourceName(); String getResourceVersion(); int getShortestPathLength(Entity firstEntity, Entity secondEntity); @Override Entity getRoot(); @Override Entity getRoot(PoS pos); String getGloss(Entity entity); Set<String> getRelatedLexemes(String lexeme, PoS pos, String sense, LexicalRelation lexicalRelation); Set<Entity> getRelatedEntities(Entity entity, SemanticRelation semanticRelation); @Override Entity getMostFrequentEntity(String lexeme); @Override Entity getMostFrequentEntity(String lexeme, PoS pos);  }
@Test public void testGetEntity() throws Exception { Set<String> expectedResults = new HashSet<String>(); expectedResults.add("UKP#-|---unk"); wikiResource.setIsCaseSensitive(false); Set<Entity> entities = wikiResource.getEntity("UKP"); assertEquals(expectedResults.size(), entities.size()); for (Entity entity : entities) { assertTrue(entity.toString(), expectedResults.contains(entity.toString())); } wikiResource.setIsCaseSensitive(true); entities = wikiResource.getEntity("uKP"); assertEquals(entities.size(), 0); }