NameParserGbifV1 implements NameParser { @Override public ParsedName parse(String s, @Nullable Rank rank) throws UnparsableException { try { return convert(s, rank, parser.parse(s, fromGbif(rank))); } catch (UnparsableNameException e) { throw new UnparsableException(NAME_TYPE_MAP.getOrDefault(e.getType(), NameType.DOUBTFUL), e.getName()); } } 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 unparsable() throws Exception { String[] unparsables = new String[]{"BOLD:AAX3687", "Potatoe virus", "Pinus alba × Abies picea Mill."}; for (String n : unparsables) { try { ParsedName pn = parser.parse(n); fail(n+ " should be unparsable"); } catch (UnparsableException e) { } } }