NameParserGbifV1 implements NameParser { @Override public String parseToCanonical(String scientificName, @Nullable Rank rank) { if (Strings.isNullOrEmpty(scientificName)) { return null; } try { ParsedName pn = parse(scientificName, rank); if (pn != null) { return pn.canonicalName(); } } catch (UnparsableException e) { logUnparsable(e); } return null; } NameParserGbifV1();  NameParserGbifV1(long timeout);  NameParserGbifV1(org.gbif.nameparser.api.NameParser parser); @Override ParsedName parse(String s, @Nullable Rank rank); @Override ParsedName parse(String scientificName); @Override ParsedName parseQuietly(String scientificName, @Nullable Rank rank); @Override ParsedName parseQuietly(String scientificName); @Override // parses the name without authorship and returns the ParsedName.canonicalName() string String parseToCanonical(String scientificName, @Nullable Rank rank); @Override String parseToCanonical(String scientificName); String parseToCanonicalOrScientificName(String scientificName); String parseToCanonicalOrScientificName(String scientificName, @Nullable Rank rank);  }
@Test public void parseToCanonical() throws Exception { assertEquals("Abies alba", parser.parseToCanonical("Abies alba Mill.")); assertNull(parser.parseToCanonical("BOLD:AAX3687", Rank.SPECIES)); }