SesameConnection implements Connection { @Override public void close() throws Exception { if (!open) { return; } try { adapter.close(); if (listener != null) { listener.connectionClosed(this); } } finally { this.open = false; } } SesameConnection(SesameAdapter adapter); void setProperties(Properties properties); @Override void close(); @Override boolean isOpen(); @Override void commit(); @Override void rollback(); @Override void setAutoCommit(boolean autoCommit); @Override boolean isAutoCommit(); @Override Statement createStatement(); @Override PreparedStatement prepareStatement(String sparql); @Override boolean isConsistent(URI context); @Override List<URI> getContexts(); @Override URI generateIdentifier(URI classUri); @Override boolean contains(Axiom<?> axiom, URI context); @Override Collection<Axiom<?>> find(AxiomDescriptor descriptor); @Override void persist(AxiomValueDescriptor descriptor); @Override void update(AxiomValueDescriptor descriptor); @Override void remove(AxiomDescriptor descriptor); @Override Lists lists(); @Override Types types(); @Override Properties properties(); @Override T unwrap(Class<T> cls);  }
@Test public void testClose() throws Exception { assertTrue(connection.isOpen()); connection.close(); assertFalse(connection.isOpen()); connection.close(); assertFalse(connection.isOpen()); verify(adapterMock).close(); }