@Test public void testGroupPlantBasionyms2() throws Exception { List<ParsedName> names = names( "Triniteurybia aberrans (A. Nelson) Brouillet, Urbatsch & R.P. Roberts", "Haplopappus aberrans (A.Nelson) H.M.Hall", "Sideranthus aberrans (A.Nelson) Rydb.", "Tonestus aberrans (A.Nelson) G.L.Nesom & D.R.Morgan", "Hysterionica aberrans (Cabrera) Cabrera", "Antennaria luzuloides ssp. aberrans (E.E. Nelson) Bayer & Stebbins", "Logfia aberrans (Wagenitz) Anderb.", "Antennaria argentea subsp. aberrans", "Filago aberrans Wagenitz", "Hysterionica aberrans var. aberrans", "Hysterionica bakeri var. aberrans Cabrera", "Macronema aberrans A.Nelson", "Senecio aberrans Greenm.", "Taraxacum aberrans Hagend. & al." ); 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 "A.Nelson": assertEquals(4, g.getRecombinations().size()); assertNotNull(g.getBasionym()); break; case "Cabrera": assertEquals(1, g.getRecombinations().size()); assertNotNull(g.getBasionym()); break; case "E.E.Nelson": assertEquals(1, g.getRecombinations().size()); assertNull(g.getBasionym()); break; case "Wagenitz": 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);  }