PoolingStorageConnector extends AbstractConnector { @Override public List<Resource> getContexts() throws SesameDriverException { READ.lock(); try { return centralConnector.getContexts(); } finally { READ.unlock(); } } PoolingStorageConnector(StorageConnector centralConnector); @Override TupleQueryResult executeSelectQuery(String query); @Override boolean executeBooleanQuery(String query); @Override void executeUpdate(String query); @Override List<Resource> getContexts(); @Override ValueFactory getValueFactory(); @Override void begin(); @Override void commit(); @Override void rollback(); @Override void close(); @Override void addStatements(Collection<Statement> statements); @Override void removeStatements(Collection<Statement> statements); @Override Collection<Statement> findStatements(Resource subject, IRI property, Value value, boolean includeInferred); @Override Collection<Statement> findStatements(Resource subject, IRI property, Value value,
                                                boolean includeInferred, IRI context); @Override boolean containsStatement(Resource subject, IRI property, Value value, boolean includeInferred); @Override boolean containsStatement(Resource subject, IRI property, Value value, boolean includeInferred, IRI context); @Override T unwrap(Class<T> cls);  }
@Test public void testGetContexts() throws Exception { connector.getContexts(); verify(readLock).lock(); verify(centralMock).getContexts(); verify(readLock).unlock(); }