BioEntityPropertyService { int assessRelevance(BioentityPropertyName bioentityPropertyName, String propertyValue) { if (ImmutableList.of(GO, PO).contains(bioentityPropertyName)) { return goPoTermTrader.get(propertyValue).map(OntologyTerm::depth).orElse(0); } else { return 0; } } @Inject  BioEntityPropertyService(SpeciesInferrer speciesInferrer,
                                    BioEntityPropertyDao bioEntityPropertyDao,
                                    ReactomeClient reactomeClient,
                                    GoPoTrader goPoTermTrader,
                                    InterProTrader interProTermTrader);   }
@Test public void onlyGoTermsHaveDepth() { when(goPoTermTraderMock.get("GO:0000001")).thenReturn(Optional.of(GO_0000001)); for (BioentityPropertyName bioentityPropertyName : BioentityPropertyName.values()) { if (bioentityPropertyName != BioentityPropertyName.GO) { assertThat(subject.assessRelevance(bioentityPropertyName, "foobar"), is(0)); } } assertThat(subject.assessRelevance(BioentityPropertyName.GO, "GO:0000001"), is(GO_0000001.depth())); }