@Test
public void testInferRank() {

  assertInferred("Asteraceae", NomCode.BOTANICAL, Rank.FAMILY);
  assertInferred("Asteraceae", null, Rank.FAMILY);
  assertInferred("Asteraceae", NomCode.ZOOLOGICAL, Rank.UNRANKED);
  assertInferred("Magnoliophyta", NomCode.BOTANICAL, Rank.PHYLUM);
  assertInferred("Fabales", NomCode.BOTANICAL, Rank.ORDER);
  assertInferred("Hominidae", NomCode.ZOOLOGICAL, Rank.FAMILY);
  assertInferred("Drosophilinae", NomCode.ZOOLOGICAL, Rank.SUBFAMILY);
  assertInferred("Agaricomycetes", NomCode.BOTANICAL, Rank.CLASS);
  assertInferred("Agaricomycetes", null, Rank.CLASS);
  assertInferred("Woodsioideae", null, Rank.SUBFAMILY);
  assertInferred("Antrophyoideae", null, Rank.SUBFAMILY);
  assertInferred("Protowoodsioideae", null, Rank.SUBFAMILY);

  assertInferred("Negarnaviricota", NomCode.VIRUS, Rank.PHYLUM);
  assertInferred("Negarnaviricota", null, Rank.PHYLUM);
  assertInferred("Picornavirales", null, Rank.ORDER);
  assertInferred("Riboviria", null, Rank.REALM);

  assertEquals(Rank.SPECIES, RankUtils.inferRank(build("Abies","Abies", "alba")));
  assertEquals(Rank.SPECIES, RankUtils.inferRank(build("Abies", null, "alba")));
  assertEquals(Rank.INFRAGENERIC_NAME, RankUtils.inferRank(build(null, "Abies", null)));
  assertEquals(Rank.INFRAGENERIC_NAME, RankUtils.inferRank(build("", "Abies", null)));
  assertEquals(Rank.SUBFAMILY, RankUtils.inferRank(build("Neurolaenodinae", null, null, NomCode.ZOOLOGICAL)));
  // should not be able to infer the correct family
  assertEquals(Rank.UNRANKED, RankUtils.inferRank(build("Compositae", null, null, NomCode.BOTANICAL)));
}