@Test public void noResultsNoFactorGrouping() { when(organismPartGroupingService.getAnatomicalSystemsGrouping(ontologyTermsAcrossExperiments)) .thenReturn(ImmutableMap.of()); when(organismPartGroupingService.getOrgansGrouping(ontologyTermsAcrossExperiments)) .thenReturn(ImmutableMap.of()); assertThat( subject.groupOrganismPartOntologyTerms(ontologyTermsAcrossExperiments), is(new JsonArray())); }
JsonArray groupOrganismPartOntologyTerms(Collection<OntologyTerm> ontologyTermsInAllFactors) { JsonArray result = new JsonArray(); groupingAsJson( organismPartGroupingService.getOrgansGrouping(ontologyTermsInAllFactors), "Organs", "Organ") .ifPresent(result::add); groupingAsJson( organismPartGroupingService.getAnatomicalSystemsGrouping(ontologyTermsInAllFactors), "Anatomical Systems", "Anatomical system") .ifPresent(result::add); return result; }
FactorGroupingService { JsonArray groupOrganismPartOntologyTerms(Collection<OntologyTerm> ontologyTermsInAllFactors) { JsonArray result = new JsonArray(); groupingAsJson( organismPartGroupingService.getOrgansGrouping(ontologyTermsInAllFactors), "Organs", "Organ") .ifPresent(result::add); groupingAsJson( organismPartGroupingService.getAnatomicalSystemsGrouping(ontologyTermsInAllFactors), "Anatomical Systems", "Anatomical system") .ifPresent(result::add); return result; } }
FactorGroupingService { JsonArray groupOrganismPartOntologyTerms(Collection<OntologyTerm> ontologyTermsInAllFactors) { JsonArray result = new JsonArray(); groupingAsJson( organismPartGroupingService.getOrgansGrouping(ontologyTermsInAllFactors), "Organs", "Organ") .ifPresent(result::add); groupingAsJson( organismPartGroupingService.getAnatomicalSystemsGrouping(ontologyTermsInAllFactors), "Anatomical Systems", "Anatomical system") .ifPresent(result::add); return result; } FactorGroupingService(OrganismPartGroupingService organismPartGroupingService); }
FactorGroupingService { JsonArray groupOrganismPartOntologyTerms(Collection<OntologyTerm> ontologyTermsInAllFactors) { JsonArray result = new JsonArray(); groupingAsJson( organismPartGroupingService.getOrgansGrouping(ontologyTermsInAllFactors), "Organs", "Organ") .ifPresent(result::add); groupingAsJson( organismPartGroupingService.getAnatomicalSystemsGrouping(ontologyTermsInAllFactors), "Anatomical Systems", "Anatomical system") .ifPresent(result::add); return result; } FactorGroupingService(OrganismPartGroupingService organismPartGroupingService); JsonArray group(String defaultQueryFactorType,
                           Collection<FactorAcrossExperiments> factorsAcrossExperiments); }
FactorGroupingService { JsonArray groupOrganismPartOntologyTerms(Collection<OntologyTerm> ontologyTermsInAllFactors) { JsonArray result = new JsonArray(); groupingAsJson( organismPartGroupingService.getOrgansGrouping(ontologyTermsInAllFactors), "Organs", "Organ") .ifPresent(result::add); groupingAsJson( organismPartGroupingService.getAnatomicalSystemsGrouping(ontologyTermsInAllFactors), "Anatomical Systems", "Anatomical system") .ifPresent(result::add); return result; } FactorGroupingService(OrganismPartGroupingService organismPartGroupingService); JsonArray group(String defaultQueryFactorType,
                           Collection<FactorAcrossExperiments> factorsAcrossExperiments);  }