SimpleListHandler extends ListHandler<SimpleListDescriptor, SimpleListValueDescriptor> { @Override OwlapiListIterator iterator(ListDescriptor descriptor) { if (descriptor.getListProperty().isInferred() || descriptor.getNextNode().isInferred()) { return new InferredSimpleListIterator(descriptor, snapshot, axiomAdapter); } else { return new SimpleListIterator(descriptor, snapshot, axiomAdapter); } } SimpleListHandler(OwlapiAdapter adapter, OntologySnapshot snapshot);   }
@Test public void persistListWithOneElementCreatesOnlyHead() { valueDescriptor.addValue(NamedResource.create(LIST_ITEMS.get(0))); listHandler.persistList(valueDescriptor); final ArgumentCaptor<List> captor = ArgumentCaptor.forClass(List.class); verify(manager).applyChanges(captor.capture()); final List<?> args = captor.getValue(); assertEquals(1, args.size()); final AddAxiom ax = (AddAxiom) args.get(0); final OWLAxiom axiom = ax.getAxiom(); assertTrue(axiom instanceof OWLObjectPropertyAssertionAxiom); final OWLObjectProperty property = axiom.objectPropertiesInSignature().iterator().next(); assertEquals(HAS_LIST.getIdentifier(), property.getIRI().toURI()); final OWLIndividual value = ((OWLObjectPropertyAssertionAxiom) axiom).getObject(); assertEquals(LIST_ITEMS.get(0), value.asOWLNamedIndividual().getIRI().toURI()); verify(adapterMock).addTransactionalChanges(anyList()); }