SesameDriver implements Closeable, ConnectionListener { Connection acquireConnection() throws SesameDriverException { assert open; final SesameAdapter adapter = new SesameAdapter(connectorFactory.createStorageConnector(configuration), configuration); final SesameConnection c = new SesameConnection(adapter); c.setLists(new SesameLists(adapter, c::ensureOpen, c::commitIfAuto)); c.setTypes(new SesameTypes(adapter, c::ensureOpen, c::commitIfAuto)); c.setProperties(new SesameProperties(adapter, c::ensureOpen, c::commitIfAuto)); openedConnections.add(c); c.setListener(this); return c; } SesameDriver(OntologyStorageProperties storageProperties, Map<String, String> properties); @Override void close(); @Override boolean isOpen(); @Override void connectionClosed(Connection connection);  }
@Test public void acquiresConnection() throws Exception { final Connection res = driver.acquireConnection(); assertNotNull(res); assertNotNull(res.lists()); verify(connectorFactoryMock).createStorageConnector(new DriverConfiguration(storageProperties)); verify(connectorFactoryMock).createStorageConnector(new DriverConfiguration(storageProperties)); }