@Test public void testGroupPlantBasionyms() throws Exception { List<ParsedName> names = names( "Gymnolomia microcephala var. abbreviata (B.L.Rob. & Greenm.) B.L.Rob. & Greenm.", "Leucheria abbreviata (Bertero) Steud.", "Centaurea phrygia subsp. abbreviata (K. Koch) Dostál", "Centaurea abbreviata (K.Koch) Hand.-Mazz.", "Jacea abbreviata (K.Koch) Soják", "Artemisia abbreviata (Krasch. ex Korobkov) Krasnob.", "Artemisia lagopus subsp. abbreviata Krasch. ex Korobkov", "Bigelowia leiosperma var. abbreviata M.E.Jones", "Brickellia oblongifolia var. abbreviata A.Gray", "Calea abbreviata Pruski & Urbatsch", "Centaurea salicifolia subsp. abbreviata K. Koch", "Chabraea abbreviata Colla ex Bertero", "Chaetanthera stuebelii Hieron. var. abbreviata Cabrera", "Conyza abbreviata Wall.", "Cousinia abbreviata Tscherneva", "Gymnolomia patens var. abbreviata B.L.Rob. & Greenm.", "Gynura abbreviata F.G.Davies", "Jacea abbreviata subsp. abbreviata", "Nassauvia abbreviata Dusén", "Nassauvia abbreviata var. abbreviata", "Scorzonera latifolia var. abbreviata Lipsch.", "Vernonia abbreviata DC." ); Collection<BasionymGroup<ParsedName>> groups = sorter.groupBasionyms(names); assertEquals(4, groups.size()); for (BasionymGroup<ParsedName> g : groups) { assertFalse(g.getRecombinations().isEmpty()); switch (g.getRecombinations().get(0).getBracketAuthorship()) { case "B.L.Rob. & Greenm.": assertEquals(1, g.getRecombinations().size()); assertNotNull(g.getBasionym()); break; case "Bertero": assertEquals(1, g.getRecombinations().size()); assertNotNull(g.getBasionym()); break; case "K.Koch": assertEquals(3, g.getRecombinations().size()); assertNotNull(g.getBasionym()); break; case "Krasch. ex Korobkov": assertEquals(1, g.getRecombinations().size()); assertNotNull(g.getBasionym()); break; default: fail("Unknown basionym group " + g.getRecombinations().get(0)); } } }
public Collection<BasionymGroup<ParsedName>> groupBasionyms(Iterable<ParsedName> names) { return groupBasionyms(names, Functions.<ParsedName>identity()); }
BasionymSorter { public Collection<BasionymGroup<ParsedName>> groupBasionyms(Iterable<ParsedName> names) { return groupBasionyms(names, Functions.<ParsedName>identity()); } }
BasionymSorter { public Collection<BasionymGroup<ParsedName>> groupBasionyms(Iterable<ParsedName> names) { return groupBasionyms(names, Functions.<ParsedName>identity()); } BasionymSorter();  BasionymSorter(AuthorComparator authorComp); }
BasionymSorter { public Collection<BasionymGroup<ParsedName>> groupBasionyms(Iterable<ParsedName> names) { return groupBasionyms(names, Functions.<ParsedName>identity()); } BasionymSorter();  BasionymSorter(AuthorComparator authorComp); Collection<BasionymGroup<ParsedName>> groupBasionyms(Iterable<ParsedName> names); Collection<BasionymGroup<T>> groupBasionyms(Iterable<T> names, Function<T, ParsedName> func); }
BasionymSorter { public Collection<BasionymGroup<ParsedName>> groupBasionyms(Iterable<ParsedName> names) { return groupBasionyms(names, Functions.<ParsedName>identity()); } BasionymSorter();  BasionymSorter(AuthorComparator authorComp); Collection<BasionymGroup<ParsedName>> groupBasionyms(Iterable<ParsedName> names); Collection<BasionymGroup<T>> groupBasionyms(Iterable<T> names, Function<T, ParsedName> func);  }