### Question:
OLSOntologyHelper extends AbstractOntologyHelper { @Override public boolean isIriInOntology(String iri) throws OntologyHelperException { checkTerm(iri); return terms.containsKey(iri) && terms.get(iri) != null; } OLSOntologyHelper(OLSOntologyConfiguration config, OLSHttpClient olsClient); @Override void updateLastCallTime(); @Override long getLastCallTime(); @Override void dispose(); @Override boolean isIriInOntology(String iri); @Override Collection<String> findLabels(String iri); @Override Collection<String> findLabelsForIRIs(Collection<String> iris); @Override Collection<String> findSynonyms(String iri); @Override Collection<String> findDefinitions(String iri); @Override Collection<String> getChildIris(String iri); @Override Collection<String> getDescendantIris(String iri); @Override Collection<String> getParentIris(String iri); @Override Collection<String> getAncestorIris(String iri); @Override Map<String, Collection<String>> getRelations(String iri); @SuppressWarnings("unused")
	static final int THREADPOOL_SIZE; static final int PAGE_SIZE; }### Answer:
@SuppressWarnings("unchecked") @Test public void isIriInOntology_badIri() throws Exception { OLSHttpClient client = mock(OLSHttpClient.class); when(client.callOLS(isA(Collection.class), eq(OntologyTerm.class))).thenReturn(Collections.emptyList()); OLSOntologyConfiguration config = new OLSOntologyConfiguration(BASE_URL, ONTOLOGY, OLSOntologyHelper.PAGE_SIZE); OLSOntologyHelper helper = new OLSOntologyHelper(config, client); assertFalse(helper.isIriInOntology(BAD_IRI)); assertFalse(helper.isIriInOntology(BAD_IRI)); verify(client).callOLS(isA(Collection.class), eq(OntologyTerm.class)); }
@SuppressWarnings("unchecked") @Test public void isIriInOntology() throws Exception { OntologyTerm term = mock(OntologyTerm.class); when(term.getIri()).thenReturn(TEST_IRI); OLSHttpClient client = mock(OLSHttpClient.class); when(client.callOLS(isA(Collection.class), eq(OntologyTerm.class))).thenReturn(Collections.singletonList(term)); OLSOntologyConfiguration config = new OLSOntologyConfiguration(BASE_URL, ONTOLOGY, OLSOntologyHelper.PAGE_SIZE); OLSOntologyHelper helper = new OLSOntologyHelper(config, client); assertTrue(helper.isIriInOntology(TEST_IRI)); assertTrue(helper.isIriInOntology(TEST_IRI)); verify(client).callOLS(isA(Collection.class), eq(OntologyTerm.class)); }