SesameDriver implements Closeable, ConnectionListener { @Override public void close() throws OntoDriverException { if (!open) { return; } try { for (SesameConnection c : openedConnections) { c.removeListener(); c.close(); } connectorFactory.close(); } catch (OntoDriverException e) { throw e; } catch (Exception e) { throw new SesameDriverException(e); } finally { this.open = false; } } SesameDriver(OntologyStorageProperties storageProperties, Map<String, String> properties); @Override void close(); @Override boolean isOpen(); @Override void connectionClosed(Connection connection);  }
@Test public void testClose() throws Exception { assertTrue(driver.isOpen()); driver.close(); assertFalse(driver.isOpen()); verify(connectorFactoryMock).close(); }