FactorGroupingService { public JsonArray group(String defaultQueryFactorType, Collection<FactorAcrossExperiments> factorsAcrossExperiments) { return "ORGANISM_PART".equalsIgnoreCase(defaultQueryFactorType) ? groupOrganismPartOntologyTerms( factorsAcrossExperiments.stream() .flatMap(FactorAcrossExperiments::getValueOntologyTerms) .collect(toList())) : new JsonArray(); } FactorGroupingService(OrganismPartGroupingService organismPartGroupingService); JsonArray group(String defaultQueryFactorType,
                           Collection<FactorAcrossExperiments> factorsAcrossExperiments);  }
@Test public void noOrganismPartNoFactorGrouping() { assertThat( subject.group("DEVELOPMENTAL_STAGE", null), is(new JsonArray())); }