@Test public void testMultiTypeDescriptions() { d1.setTypes(ImmutableSortedSet.<DescriptionType>of(useAnimalFoodBees, morphologyReproductiveFlower)); d1.setDescription("BEES!!!"); taxon.setDescriptions(ImmutableSet.<Description>of(d1)); Descriptions uses = new Descriptions(taxon, true); for(DescriptionsBySource dbs : uses.getBySource()) { for(DescriptionsByType dbt : dbs.byType) { assertEquals("useAnimalFoodBees", dbt.type); } } Descriptions desc = new Descriptions(taxon); assertEquals(0, desc.getBySource().size()); }
public Collection<DescriptionsBySource> getBySource() { if(descriptionsBySource == null) { descriptionsBySource = new ArrayList<>(); if(taxon.looksAccepted()) { partitionBySource(taxon); for(Taxon synonym : taxon.getSynonymNameUsages()) { partitionBySource(synonym); } Collections.sort(descriptionsBySource); } } return descriptionsBySource; }
Descriptions { public Collection<DescriptionsBySource> getBySource() { if(descriptionsBySource == null) { descriptionsBySource = new ArrayList<>(); if(taxon.looksAccepted()) { partitionBySource(taxon); for(Taxon synonym : taxon.getSynonymNameUsages()) { partitionBySource(synonym); } Collections.sort(descriptionsBySource); } } return descriptionsBySource; } }
Descriptions { public Collection<DescriptionsBySource> getBySource() { if(descriptionsBySource == null) { descriptionsBySource = new ArrayList<>(); if(taxon.looksAccepted()) { partitionBySource(taxon); for(Taxon synonym : taxon.getSynonymNameUsages()) { partitionBySource(synonym); } Collections.sort(descriptionsBySource); } } return descriptionsBySource; } Descriptions(Taxon taxon);  Descriptions(Taxon taxon, boolean isUses); }
Descriptions { public Collection<DescriptionsBySource> getBySource() { if(descriptionsBySource == null) { descriptionsBySource = new ArrayList<>(); if(taxon.looksAccepted()) { partitionBySource(taxon); for(Taxon synonym : taxon.getSynonymNameUsages()) { partitionBySource(synonym); } Collections.sort(descriptionsBySource); } } return descriptionsBySource; } Descriptions(Taxon taxon);  Descriptions(Taxon taxon, boolean isUses); @JsonSerialize(contentUsing = BaseSerializer.class) List<Taxon> getSynonymsIncluded(); Collection<DescriptionsBySource> getBySource(); }
Descriptions { public Collection<DescriptionsBySource> getBySource() { if(descriptionsBySource == null) { descriptionsBySource = new ArrayList<>(); if(taxon.looksAccepted()) { partitionBySource(taxon); for(Taxon synonym : taxon.getSynonymNameUsages()) { partitionBySource(synonym); } Collections.sort(descriptionsBySource); } } return descriptionsBySource; } Descriptions(Taxon taxon);  Descriptions(Taxon taxon, boolean isUses); @JsonSerialize(contentUsing = BaseSerializer.class) List<Taxon> getSynonymsIncluded(); Collection<DescriptionsBySource> getBySource();  }