@Test public void testCopyOrganizations() { Organization org = new Organization(); org.setName("Naturalis"); List<Organization> gatheringOrganizations = new ArrayList<>(); gatheringOrganizations.add(org); Object obj = ReflectionUtil.callStatic(SummaryObjectUtil.class, "copyOrganizations", new Class[] {List.class}, new Object[] {gatheringOrganizations}); List<SummaryOrganization> list = (List<SummaryOrganization>) obj; SummaryOrganization actual = list.get(0); assertNotNull("01", actual); assertEquals("02", "Naturalis", actual.getName()); }
private static List<SummaryOrganization> copyOrganizations(List<Organization> organizations) { if (organizations == null) { return null; } List<SummaryOrganization> summaries = new ArrayList<>(organizations.size()); for (Organization o : organizations) { summaries.add(new SummaryOrganization(o.getName())); } return summaries; }
SummaryObjectUtil { private static List<SummaryOrganization> copyOrganizations(List<Organization> organizations) { if (organizations == null) { return null; } List<SummaryOrganization> summaries = new ArrayList<>(organizations.size()); for (Organization o : organizations) { summaries.add(new SummaryOrganization(o.getName())); } return summaries; } }
SummaryObjectUtil { private static List<SummaryOrganization> copyOrganizations(List<Organization> organizations) { if (organizations == null) { return null; } List<SummaryOrganization> summaries = new ArrayList<>(organizations.size()); for (Organization o : organizations) { summaries.add(new SummaryOrganization(o.getName())); } return summaries; } private  SummaryObjectUtil(); }
SummaryObjectUtil { private static List<SummaryOrganization> copyOrganizations(List<Organization> organizations) { if (organizations == null) { return null; } List<SummaryOrganization> summaries = new ArrayList<>(organizations.size()); for (Organization o : organizations) { summaries.add(new SummaryOrganization(o.getName())); } 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<SummaryOrganization> copyOrganizations(List<Organization> organizations) { if (organizations == null) { return null; } List<SummaryOrganization> summaries = new ArrayList<>(organizations.size()); for (Organization o : organizations) { summaries.add(new SummaryOrganization(o.getName())); } 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);  }