@Test public void testCopyTaxon() { ScientificName scientificName = new ScientificName(); scientificName.setFullScientificName("Bombus affinis Cresson, 1863"); scientificName.setScientificNameGroup("bombus affinis"); scientificName.setAuthorshipVerbatim("Cresson, 1863"); scientificName.setGenusOrMonomial("Larus"); scientificName.setSpecificEpithet("affinis"); scientificName.setInfraspecificEpithet(""); scientificName.setTaxonomicStatus(TaxonomicStatus.ACCEPTED_NAME); Monomial monomial = new Monomial(); monomial.setName("Plantae"); monomial.setRank("kingdom"); TaxonomicRank rank = TaxonomicRank.KINGDOM; DefaultClassification defaultClassification = new DefaultClassification(); defaultClassification.set(monomial); SourceSystem sourceSystem = SourceSystem.getInstance("COL", "Species 2000 - Catalogue Of Life"); Taxon taxon = new Taxon(); taxon.setAcceptedName(scientificName); taxon.setDefaultClassification(defaultClassification); taxon.setSourceSystem(sourceSystem); taxon.setId("6931870@COL"); SummaryTaxon actual = SummaryObjectUtil.copyTaxon(taxon); assertNotNull(actual); assertEquals("01", "Bombus affinis Cresson, 1863", actual.getAcceptedName().getFullScientificName()); assertEquals("02", "Larus", actual.getAcceptedName().getGenusOrMonomial()); assertEquals("03", "Plantae", actual.getDefaultClassification().get(rank)); assertEquals("04", "COL", actual.getSourceSystem().getCode()); }
public static SummaryTaxon copyTaxon(Taxon taxon) { SummaryTaxon summary = new SummaryTaxon(); summary.setId(taxon.getId()); summary.setAcceptedName(copyScientificName(taxon.getAcceptedName())); summary.setDefaultClassification(taxon.getDefaultClassification()); summary.setSourceSystem(copySourceSystem(taxon.getSourceSystem())); return summary; }
SummaryObjectUtil { public static SummaryTaxon copyTaxon(Taxon taxon) { SummaryTaxon summary = new SummaryTaxon(); summary.setId(taxon.getId()); summary.setAcceptedName(copyScientificName(taxon.getAcceptedName())); summary.setDefaultClassification(taxon.getDefaultClassification()); summary.setSourceSystem(copySourceSystem(taxon.getSourceSystem())); return summary; } }
SummaryObjectUtil { public static SummaryTaxon copyTaxon(Taxon taxon) { SummaryTaxon summary = new SummaryTaxon(); summary.setId(taxon.getId()); summary.setAcceptedName(copyScientificName(taxon.getAcceptedName())); summary.setDefaultClassification(taxon.getDefaultClassification()); summary.setSourceSystem(copySourceSystem(taxon.getSourceSystem())); return summary; } private  SummaryObjectUtil(); }
SummaryObjectUtil { public static SummaryTaxon copyTaxon(Taxon taxon) { SummaryTaxon summary = new SummaryTaxon(); summary.setId(taxon.getId()); summary.setAcceptedName(copyScientificName(taxon.getAcceptedName())); summary.setDefaultClassification(taxon.getDefaultClassification()); summary.setSourceSystem(copySourceSystem(taxon.getSourceSystem())); return summary; } private  SummaryObjectUtil(); static SummarySpecimen copySpecimen(Specimen specimen, String nameGroup); static SummaryTaxon copyTaxon(Taxon taxon); static SummaryScientificName copyScientificName(ScientificName sn); static SummaryVernacularName copySummaryVernacularName(VernacularName vn); static SummarySourceSystem copySourceSystem(SourceSystem ss); }
SummaryObjectUtil { public static SummaryTaxon copyTaxon(Taxon taxon) { SummaryTaxon summary = new SummaryTaxon(); summary.setId(taxon.getId()); summary.setAcceptedName(copyScientificName(taxon.getAcceptedName())); summary.setDefaultClassification(taxon.getDefaultClassification()); summary.setSourceSystem(copySourceSystem(taxon.getSourceSystem())); return summary; } private  SummaryObjectUtil(); static SummarySpecimen copySpecimen(Specimen specimen, String nameGroup); static SummaryTaxon copyTaxon(Taxon taxon); static SummaryScientificName copyScientificName(ScientificName sn); static SummaryVernacularName copySummaryVernacularName(VernacularName vn); static SummarySourceSystem copySourceSystem(SourceSystem ss);  }