DefaultStorageAccessor implements StorageAccessor { @Override public void close() { if (!open) { return; } try { dataSource.close(); } catch (OntoDriverException e) { throw new StorageAccessException("Error when closing the data source.", e); } finally { this.open = false; } } DefaultStorageAccessor(OntologyStorageProperties storageProperties, Map<String, String> properties); @Override Connection acquireConnection(); @Override void close(); @Override boolean isOpen(); @Override T unwrap(Class<T> cls);  }
@Test void testClose() { final DefaultStorageAccessor a = new DefaultStorageAccessor(storageProperties(DATA_SOURCE_CLASS), Collections.emptyMap()); assertTrue(a.isOpen()); a.close(); assertFalse(a.isOpen()); }