OwlapiTypes implements Types { @Override public Set<Axiom<URI>> getTypes(NamedResource individual, URI context, boolean includeInferred) throws OntoDriverException { Objects.requireNonNull(individual, getNPXMessageSupplier("individual")); beforeCallback.execute(); return adapter.getTypesHandler().getTypes(individual, context, includeInferred); } OwlapiTypes(OwlapiAdapter adapter, Procedure beforeCallback, Procedure afterChangeCallback); @Override Set<Axiom<URI>> getTypes(NamedResource individual, URI context, boolean includeInferred); @Override void addTypes(NamedResource individual, URI context, Set<URI> types); @Override void removeTypes(NamedResource individual, URI context, Set<URI> types);  }
@Test public void getTypesReturnsTypes() throws Exception { when(typesHandlerMock.getTypes(INDIVIDUAL, null, false)).thenReturn(Collections.singleton( new AxiomImpl<>(INDIVIDUAL, Assertion.createClassAssertion(false), new Value<>(INDIVIDUAL.getIdentifier())))); final Set<Axiom<URI>> res = types.getTypes(INDIVIDUAL, null, false); assertEquals(1, res.size()); assertEquals(INDIVIDUAL.getIdentifier(), res.iterator().next().getValue().getValue()); verify(typesHandlerMock).getTypes(INDIVIDUAL, null, false); }