@Test public void testLookup() throws Exception { assertNull(comp.lookup(null)); assertEquals(" ", comp.lookup(" ")); assertEquals(".", comp.lookup(".")); assertEquals("-", comp.lookup("-")); assertEquals("Döring", comp.lookup("Döring")); assertEquals("desireno", comp.lookup("desireno")); assertEquals("a j white", comp.lookup("a j white")); assertEquals("l a colla", comp.lookup("colla")); assertEquals("j a schultes", comp.lookup("schult")); assertEquals("s a nevski", comp.lookup("nevski")); assertEquals("w q yin", comp.lookup("w q yin")); assertEquals("g kirchner", comp.lookup("g kirchn")); assertEquals("c f a christensen", comp.lookup("c chr")); assertEquals("h christ", comp.lookup("h christ")); assertEquals("c linnaus", comp.lookup("l")); assertEquals("h g l reichenbach", comp.lookup("rchb")); assertEquals("a p de candolle", comp.lookup("dc")); assertEquals("j lamarck", comp.lookup("lam")); assertEquals("lam,dc", comp.lookup("lam,dc")); assertEquals("c linnaus filius", comp.lookup("l filius")); assertEquals("c h bipontinus schultz", comp.lookup("sch bip")); assertEquals("c h bipontinus schultz", comp.lookup("schultz bip")); }
@VisibleForTesting protected String lookup(String normalizedAuthor) { if (normalizedAuthor != null && authorMap.containsKey(normalizedAuthor)) { return authorMap.get(normalizedAuthor); } else { return normalizedAuthor; } }
AuthorComparator { @VisibleForTesting protected String lookup(String normalizedAuthor) { if (normalizedAuthor != null && authorMap.containsKey(normalizedAuthor)) { return authorMap.get(normalizedAuthor); } else { return normalizedAuthor; } } }
AuthorComparator { @VisibleForTesting protected String lookup(String normalizedAuthor) { if (normalizedAuthor != null && authorMap.containsKey(normalizedAuthor)) { return authorMap.get(normalizedAuthor); } else { return normalizedAuthor; } } private  AuthorComparator(Map<String, String> authors); }
AuthorComparator { @VisibleForTesting protected String lookup(String normalizedAuthor) { if (normalizedAuthor != null && authorMap.containsKey(normalizedAuthor)) { return authorMap.get(normalizedAuthor); } else { return normalizedAuthor; } } private  AuthorComparator(Map<String, String> authors); static AuthorComparator createWithoutAuthormap(); static AuthorComparator createWithAuthormap(); static AuthorComparator createWithAuthormap(Map<String, String> authorMap); Equality compare(@Nullable String authors1, @Nullable String year1, @Nullable String authors2, @Nullable String year2); Equality compare(ParsedName n1, ParsedName n2); boolean compareStrict(String author1, @Nullable String year1, String author2, @Nullable String year2); }
AuthorComparator { @VisibleForTesting protected String lookup(String normalizedAuthor) { if (normalizedAuthor != null && authorMap.containsKey(normalizedAuthor)) { return authorMap.get(normalizedAuthor); } else { return normalizedAuthor; } } private  AuthorComparator(Map<String, String> authors); static AuthorComparator createWithoutAuthormap(); static AuthorComparator createWithAuthormap(); static AuthorComparator createWithAuthormap(Map<String, String> authorMap); Equality compare(@Nullable String authors1, @Nullable String year1, @Nullable String authors2, @Nullable String year2); Equality compare(ParsedName n1, ParsedName n2); boolean compareStrict(String author1, @Nullable String year1, String author2, @Nullable String year2);  }