SesameProperties implements Properties { @Override public void addProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties) throws OntoDriverException { beforeCallback.execute(); new AxiomSaver(connector, valueFactory).persistAxioms(individual, properties, context); afterChangeCallback.execute(); } SesameProperties(SesameAdapter adapter, Procedure beforeCallback, Procedure afterChangeCallback); @Override Collection<Axiom<?>> getProperties(NamedResource individual, URI context, boolean includeInferred); @Override void addProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties); @Override void removeProperties(NamedResource individual, URI context, Map<Assertion, Set<Value<?>>> properties);  }
@Test void testAddProperties() throws Exception { final Map<Assertion, Set<Value<?>>> toAdd = initProperties(); final Collection<Statement> statements = statementsForProperties(toAdd); properties.addProperties(SUBJECT, null, toAdd); final ArgumentCaptor<Collection> captor = ArgumentCaptor.forClass(Collection.class); verify(connectorMock).addStatements(captor.capture()); final Collection<?> added = captor.getValue(); assertEquals(statements.size(), added.size()); assertTrue(statements.containsAll(added)); }