class NameParserGbifV1 implements NameParser {

  @Override
  // parses the name without authorship and returns the ParsedName.canonicalName() string
  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;
  }

}

class NameParserGbifV1Test {

  private static final boolean DEBUG;
   NameParserGbifV1 parser;

  @Test
  public void parseToCanonical() throws Exception {

    assertEquals("Abies alba", parser.parseToCanonical("Abies alba Mill."));
    assertNull(parser.parseToCanonical("BOLD:AAX3687", Rank.SPECIES));
  }

}