TypesHandler { void addTypes(NamedResource individual, URI context, Set<URI> types) throws SesameDriverException { final Collection<Statement> statements = prepareSesameStatements(individual, context, types); connector.addStatements(statements); } TypesHandler(Connector connector, ValueFactory valueFactory);   }
@Test public void testPersistTypes() throws Exception { final Set<java.net.URI> types = initTypes(); handler.addTypes(NAMED_PK, null, types); final ArgumentCaptor<Collection> captor = ArgumentCaptor.forClass(Collection.class); verify(connectorMock).addStatements(captor.capture()); final Collection<?> statements = captor.getValue(); assertEquals(types.size(), statements.size()); for (Object o : statements) { final Statement stmt = (Statement) o; assertEquals(STR_PK, stmt.getSubject().stringValue()); assertTrue(types.contains(java.net.URI.create(stmt.getObject().stringValue()))); } }