@Test public void testCopyIdentification() { 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"); DefaultClassification defaultClassification = new DefaultClassification(); defaultClassification.set(monomial); SpecimenTypeStatus typeStatus = SpecimenTypeStatus.ISOLECTOTYPE; TaxonomicEnrichment taxonomicEnrichments = new TaxonomicEnrichment(); taxonomicEnrichments.setTaxonId("L.1911711@BRAHMS"); List<TaxonomicEnrichment> enrichments = new ArrayList<>(); enrichments.add(taxonomicEnrichments); SpecimenIdentification identification = new SpecimenIdentification(); identification.setScientificName(scientificName); identification.setDefaultClassification(defaultClassification); identification.setTypeStatus(typeStatus); identification.setTaxonomicEnrichments(enrichments); Object obj = ReflectionUtil.callStatic(SummaryObjectUtil.class, "copyIdentification", new Class[] {SpecimenIdentification.class}, new Object[] {identification}); SummarySpecimenIdentification actual = (SummarySpecimenIdentification) obj; assertNotNull("01", actual); assertEquals("02", "Bombus affinis Cresson, 1863", actual.getScientificName().getFullScientificName()); assertEquals("03", "Larus", actual.getScientificName().getGenusOrMonomial()); assertEquals("04", "Cresson, 1863", actual.getScientificName().getAuthorshipVerbatim()); assertEquals("05", "affinis", actual.getScientificName().getSpecificEpithet()); assertEquals("06", "accepted name", actual.getScientificName().getTaxonomicStatus().toString()); assertEquals("07", "L.1911711@BRAHMS", actual.getTaxonomicEnrichments().get(0).getTaxonId()); }
private static SummarySpecimenIdentification copyIdentification(SpecimenIdentification si) { SummarySpecimenIdentification ssi = new SummarySpecimenIdentification(); ssi.setTypeStatus(si.getTypeStatus()); ssi.setDefaultClassification(si.getDefaultClassification()); ssi.setScientificName(copyScientificName(si.getScientificName())); ssi.setTaxonomicEnrichments(si.getTaxonomicEnrichments()); return ssi; }
SummaryObjectUtil { private static SummarySpecimenIdentification copyIdentification(SpecimenIdentification si) { SummarySpecimenIdentification ssi = new SummarySpecimenIdentification(); ssi.setTypeStatus(si.getTypeStatus()); ssi.setDefaultClassification(si.getDefaultClassification()); ssi.setScientificName(copyScientificName(si.getScientificName())); ssi.setTaxonomicEnrichments(si.getTaxonomicEnrichments()); return ssi; } }
SummaryObjectUtil { private static SummarySpecimenIdentification copyIdentification(SpecimenIdentification si) { SummarySpecimenIdentification ssi = new SummarySpecimenIdentification(); ssi.setTypeStatus(si.getTypeStatus()); ssi.setDefaultClassification(si.getDefaultClassification()); ssi.setScientificName(copyScientificName(si.getScientificName())); ssi.setTaxonomicEnrichments(si.getTaxonomicEnrichments()); return ssi; } private  SummaryObjectUtil(); }
SummaryObjectUtil { private static SummarySpecimenIdentification copyIdentification(SpecimenIdentification si) { SummarySpecimenIdentification ssi = new SummarySpecimenIdentification(); ssi.setTypeStatus(si.getTypeStatus()); ssi.setDefaultClassification(si.getDefaultClassification()); ssi.setScientificName(copyScientificName(si.getScientificName())); ssi.setTaxonomicEnrichments(si.getTaxonomicEnrichments()); return ssi; } 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 { private static SummarySpecimenIdentification copyIdentification(SpecimenIdentification si) { SummarySpecimenIdentification ssi = new SummarySpecimenIdentification(); ssi.setTypeStatus(si.getTypeStatus()); ssi.setDefaultClassification(si.getDefaultClassification()); ssi.setScientificName(copyScientificName(si.getScientificName())); ssi.setTaxonomicEnrichments(si.getTaxonomicEnrichments()); return ssi; } 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);  }