@Test public void testCopyPersons() { Organization org = new Organization(); org.setName("Naturalis"); List<Organization> gatheringOrganizations = new ArrayList<>(); gatheringOrganizations.add(org); Person person = new Person(); person.setFullName("Plabon Kakoti"); person.setOrganization(org); person.setAgentText("test"); List<Person> list = new ArrayList<>(); list.add(person); Object obj = ReflectionUtil.callStatic(SummaryObjectUtil.class, "copyPersons", new Class[] {List.class}, new Object[] {list}); List<SummaryPerson> actualList = (List<SummaryPerson>) obj; SummaryPerson actual = actualList.get(0); assertNotNull("01", actual); assertEquals("02", "Plabon Kakoti", actual.getFullName()); assertEquals("03", "Naturalis", actual.getOrganization().getName()); }
private static List<SummaryPerson> copyPersons(List<Person> persons) { if (persons == null) { return null; } List<SummaryPerson> summaries = new ArrayList<>(persons.size()); for (Person p : persons) { SummaryPerson sp = new SummaryPerson(); sp.setFullName(p.getFullName()); sp.setOrganization(copyOrganization(p.getOrganization())); summaries.add(sp); } return summaries; }
SummaryObjectUtil { private static List<SummaryPerson> copyPersons(List<Person> persons) { if (persons == null) { return null; } List<SummaryPerson> summaries = new ArrayList<>(persons.size()); for (Person p : persons) { SummaryPerson sp = new SummaryPerson(); sp.setFullName(p.getFullName()); sp.setOrganization(copyOrganization(p.getOrganization())); summaries.add(sp); } return summaries; } }
SummaryObjectUtil { private static List<SummaryPerson> copyPersons(List<Person> persons) { if (persons == null) { return null; } List<SummaryPerson> summaries = new ArrayList<>(persons.size()); for (Person p : persons) { SummaryPerson sp = new SummaryPerson(); sp.setFullName(p.getFullName()); sp.setOrganization(copyOrganization(p.getOrganization())); summaries.add(sp); } return summaries; } private  SummaryObjectUtil(); }
SummaryObjectUtil { private static List<SummaryPerson> copyPersons(List<Person> persons) { if (persons == null) { return null; } List<SummaryPerson> summaries = new ArrayList<>(persons.size()); for (Person p : persons) { SummaryPerson sp = new SummaryPerson(); sp.setFullName(p.getFullName()); sp.setOrganization(copyOrganization(p.getOrganization())); summaries.add(sp); } return summaries; } 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 List<SummaryPerson> copyPersons(List<Person> persons) { if (persons == null) { return null; } List<SummaryPerson> summaries = new ArrayList<>(persons.size()); for (Person p : persons) { SummaryPerson sp = new SummaryPerson(); sp.setFullName(p.getFullName()); sp.setOrganization(copyOrganization(p.getOrganization())); summaries.add(sp); } return summaries; } 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);  }