@Test
public void testBuildName() throws Exception {

  pn.setUninomial("Pseudomonas");
  assertName("Pseudomonas");
  assertHtml("<i>Pseudomonas</i>");
  
  pn.setUninomial(null);
  pn.setGenus("Pseudomonas");
  pn.setSpecificEpithet("syringae");
  assertName("Pseudomonas syringae");
  assertHtml("<i>Pseudomonas</i> <i>syringae</i>");
  pn.setCombinationAuthorship(Authorship.authors("Van Hall"));
  assertName("Pseudomonas syringae", "Pseudomonas syringae Van Hall");
  assertHtml("<i>Pseudomonas</i> <i>syringae</i> Van Hall");
  
  pn.getCombinationAuthorship().setYear("1904");
  assertName("Pseudomonas syringae", "Pseudomonas syringae Van Hall, 1904");
  assertHtml("<i>Pseudomonas</i> <i>syringae</i> Van Hall, 1904");
  pn.setBasionymAuthorship(Authorship.authors("Carl."));
  assertName("Pseudomonas syringae", "Pseudomonas syringae (Carl.) Van Hall, 1904");
  assertHtml("<i>Pseudomonas</i> <i>syringae</i> (Carl.) Van Hall, 1904");
  
  pn.setRank(Rank.PATHOVAR);
  pn.setInfraspecificEpithet("aceris");
  pn.getBasionymAuthorship().getAuthors().clear();
  assertName("Pseudomonas syringae aceris", "Pseudomonas syringae pv. aceris Van Hall, 1904");
  assertHtml("<i>Pseudomonas</i> <i>syringae</i> pv. <i>aceris</i> Van Hall, 1904");
  
  pn.setStrain("CFBP 2339");
  assertName("Pseudomonas syringae aceris", "Pseudomonas syringae pv. aceris Van Hall, 1904 CFBP 2339");
  assertHtml("<i>Pseudomonas</i> <i>syringae</i> pv. <i>aceris</i> Van Hall, 1904 CFBP 2339");
  
  pn.getCombinationAuthorship().setYear(null);
  pn.getCombinationAuthorship().getAuthors().clear();
  assertName("Pseudomonas syringae aceris", "Pseudomonas syringae pv. aceris CFBP 2339");
  
  pn.setTaxonomicNote("tax note");
  assertHtml("<i>Pseudomonas</i> <i>syringae</i> pv. <i>aceris</i> CFBP 2339 tax note");
  
  pn = new ParsedName();
  pn.setGenus("Abax");
  pn.setSpecificEpithet("carinatus");
  pn.setInfraspecificEpithet("carinatus");
  pn.setBasionymAuthorship(Authorship.yearAuthors("1812", "Duftschmid"));
  pn.setRank(Rank.UNRANKED);
  assertName("Abax carinatus carinatus");
  
  pn.setRank(null);
  assertName("Abax carinatus carinatus");
  
  pn.setInfraspecificEpithet("urinatus");
  assertName("Abax carinatus urinatus", "Abax carinatus urinatus (Duftschmid, 1812)");
  
  pn.setRank(null);
  assertName("Abax carinatus urinatus", "Abax carinatus urinatus (Duftschmid, 1812)");
  
  pn.setRank(Rank.SUBSPECIES);
  assertName("Abax carinatus urinatus", "Abax carinatus urinatus (Duftschmid, 1812)");
  
  pn.setCode(NomCode.BOTANICAL);
  assertName("Abax carinatus urinatus", "Abax carinatus subsp. urinatus (Duftschmid, 1812)");
  
  
  pn = new ParsedName();
  pn.setGenus("Polypodium");
  pn.setSpecificEpithet("vulgare");
  pn.setInfraspecificEpithet("mantoniae");
  pn.setBasionymAuthorship(Authorship.authors("Rothm."));
  pn.setCombinationAuthorship(Authorship.authors("Schidlay"));
  pn.setRank(Rank.SUBSPECIES);
  pn.setNotho(NamePart.INFRASPECIFIC);
  assertName(
      "Polypodium vulgare mantoniae",
      "Polypodium vulgare nothosubsp. mantoniae (Rothm.) Schidlay",
      "Polypodium vulgare nothosubsp. mantoniae (Rothm.) Schidlay");
}