OrgSynonymGenerator { public void computeSynonyms(Entity entity) { NameOrg name = (NameOrg) entity.getName(); name.addSynonymNorm(name.getName()); processAbbrev(name, lastWordsAbbrev(name, name.getName())); companyTerms(name, name.getName()); String prefixLvl1 = prefix(name, name.getName()); String suffixLvl1 = suffix(name, name.getName()); String prefixSuffix2 = prefix(name, suffixLvl1); companyTerms(name, prefixLvl1); companyTerms(name, suffixLvl1); processAbbrev(name, lastWordsAbbrev(name, suffixLvl1)); processAbbrev(name, lastWordsAbbrev(name, prefixLvl1)); companyTerms(name, prefixSuffix2); andWords(name); andSymbolVariants(name); multiWordAbbrev(name); if (entity.getAddress() != null && CountryCode.CN.equals(entity.getAddress().getCountry())) { chineseCompanyNames(name); } name.setSuffix(suffixes.toString()); }  void computeSynonyms(Entity entity);  }
@Test public void CompanySynonyms() { OrgSynonymGenerator generator = new OrgSynonymGenerator(); for (Entry<Assignee, List<String>> entry : COMPANIES.entrySet()) { NameOrg name = (NameOrg) entry.getKey().getName(); generator.computeSynonyms(entry.getKey()); assertTrue("Failed '" + entry.getKey() + "'\n\t Missing: " + missingSynonyms(name, entry.getValue()) + "\n\t expect to contain: " + entry.getValue().toString() + "\n\t actual: " + name.getSynonyms().toString(), name.getSynonyms().containsAll(entry.getValue())); } }