JenaPreparedStatement extends JenaStatement implements PreparedStatement { @Override public ResultSet executeQuery() throws JenaDriverException { ensureOpen(); return executeQuery(holder.assembleStatement()); } JenaPreparedStatement(StatementExecutor executor, String sparql); @Override ResultSet executeQuery(); @Override void executeUpdate(); @Override void setObject(String binding, Object value); @Override void clearParameters();  }
@Test public void executeQueryThrowsIllegalStateForClosedStatement() throws Exception { thrown.expect(IllegalStateException.class); thrown.expectMessage(containsString("Statement is closed")); this.statement = new JenaPreparedStatement(executor, QUERY); statement.close(); statement.executeQuery(); }