### Question:
KernelStatement extends CloseableResourceManager implements TxStateHolder, Statement, AssertOpen { @Override public void assertOpen() { if ( referenceCount == 0 ) { throw new NotInTransactionException( "The statement has been closed." ); } Optional<Status> terminationReason = transaction.getReasonIfTerminated(); terminationReason.ifPresent( status -> { throw new TransactionTerminatedException( status ); } ); } KernelStatement( KernelTransactionImplementation transaction,
            TxStateHolder txStateHolder,
            StorageReader storageReader,
            LockTracer systemLockTracer,
            StatementOperationParts statementOperations,
            ClockContext clockContext,
            VersionContextSupplier versionContextSupplier ); @Override QueryRegistryOperations queryRegistration(); @Override TransactionState txState(); @Override AuxiliaryTransactionState auxiliaryTxState( Object providerIdentityKey ); @Override ExplicitIndexTransactionState explicitIndexTxState(); @Override boolean hasTxStateWithChanges(); @Override void close(); @Override void assertOpen(); void initialize( StatementLocks statementLocks, PageCursorTracer pageCursorCounters ); StatementLocks locks(); LockTracer lockTracer(); PageCursorTracer getPageCursorTracer(); final void acquire(); KernelTransactionImplementation getTransaction(); VersionContext getVersionContext(); ClockContext clocks();  }### Answer:
@Test( expected = NotInTransactionException.class ) public void assertStatementIsNotOpenWhileAcquireIsNotInvoked() { KernelTransactionImplementation transaction = mock( KernelTransactionImplementation.class ); TxStateHolder txStateHolder = mock( TxStateHolder.class ); StorageReader storeStatement = mock( StorageReader.class ); KernelStatement statement = new KernelStatement( transaction, txStateHolder, storeStatement, LockTracer.NONE, mock( StatementOperationParts.class ), new ClockContext(), EmptyVersionContextSupplier.EMPTY ); statement.assertOpen(); }