@Test public void testExtractIdsFromSpecimens() { ScientificName scientificName = new ScientificName(); scientificName.setFullScientificName("Bombus affinis Cresson, 1863"); scientificName.setScientificNameGroup("bombus affinis"); SpecimenIdentification identification = new SpecimenIdentification(); identification.setScientificName(scientificName); Specimen specimen = new Specimen(); specimen.setId("L.1911711@BRAHMS"); specimen.addIndentification(identification); List<Specimen> specimens = new ArrayList<>(); specimens.add(specimen); Object actual = ReflectionUtil.callStatic(EnrichmentUtil.class, "extractIdsFromSpecimens", new Class[] {List.class}, new Object[] {specimens}); String[] resultArray = (String[]) actual; String expectedId = "L.1911711@BRAHMS"; assertNotNull("01", resultArray); assertEquals("02", expectedId, resultArray[0]); }
private static String[] extractIdsFromSpecimens(List<Specimen> specimens) { HashSet<String> ids = new HashSet<>(specimens.size()); for (Specimen s : specimens) { ids.add(s.getId()); } return ids.toArray(new String[ids.size()]); }
EnrichmentUtil { private static String[] extractIdsFromSpecimens(List<Specimen> specimens) { HashSet<String> ids = new HashSet<>(specimens.size()); for (Specimen s : specimens) { ids.add(s.getId()); } return ids.toArray(new String[ids.size()]); } }
EnrichmentUtil { private static String[] extractIdsFromSpecimens(List<Specimen> specimens) { HashSet<String> ids = new HashSet<>(specimens.size()); for (Specimen s : specimens) { ids.add(s.getId()); } return ids.toArray(new String[ids.size()]); }  }
EnrichmentUtil { private static String[] extractIdsFromSpecimens(List<Specimen> specimens) { HashSet<String> ids = new HashSet<>(specimens.size()); for (Specimen s : specimens) { ids.add(s.getId()); } return ids.toArray(new String[ids.size()]); }  static List<TaxonomicEnrichment> createEnrichments(List<Taxon> taxa); }
EnrichmentUtil { private static String[] extractIdsFromSpecimens(List<Specimen> specimens) { HashSet<String> ids = new HashSet<>(specimens.size()); for (Specimen s : specimens) { ids.add(s.getId()); } return ids.toArray(new String[ids.size()]); }  static List<TaxonomicEnrichment> createEnrichments(List<Taxon> taxa);  }