### Question:
Neo4jTransactionalContext implements TransactionalContext { @Override public void check() { kernelTransaction().assertOpen(); } Neo4jTransactionalContext(
            GraphDatabaseQueryService graph,
            ThreadToStatementContextBridge txBridge,
            PropertyContainerLocker locker,
            InternalTransaction initialTransaction,
            Statement initialStatement,
            ExecutingQuery executingQuery,
            Kernel kernel
    ); @Override ExecutingQuery executingQuery(); @Override DbmsOperations dbmsOperations(); @Override KernelTransaction kernelTransaction(); @Override boolean isTopLevelTx(); @Override void close( boolean success ); @Override void terminate(); @Override void commitAndRestartTx(); @Override void cleanForReuse(); @Override TransactionalContext getOrBeginNewIfClosed(); @Override boolean isOpen(); @Override GraphDatabaseQueryService graph(); @Override Statement statement(); @Override void check(); @Override TxStateHolder stateView(); @Override Lock acquireWriteLock( PropertyContainer p ); @Override KernelTransaction.Revertable restrictCurrentTransaction( SecurityContext context ); @Override SecurityContext securityContext(); @Override ResourceTracker resourceTracker(); @Override StatisticProvider kernelStatisticProvider(); Neo4jTransactionalContext copyFrom( GraphDatabaseQueryService graph,
            ThreadToStatementContextBridge txBridge, PropertyContainerLocker locker,
            InternalTransaction initialTransaction,
            Statement initialStatement,
            ExecutingQuery executingQuery ); final KernelTransaction.Type transactionType; final SecurityContext securityContext; }### Answer:
@Test public void checkKernelStatementOnCheck() { InternalTransaction initialTransaction = mock( InternalTransaction.class, new ReturnsDeepStubs() ); Kernel kernel = mock( Kernel.class ); ThreadToStatementContextBridge txBridge = mock( ThreadToStatementContextBridge.class ); KernelTransaction kernelTransaction = mockTransaction( initialStatement ); when( txBridge.getKernelTransactionBoundToThisThread( true ) ).thenReturn( kernelTransaction ); Neo4jTransactionalContext transactionalContext = new Neo4jTransactionalContext( null, txBridge, null, initialTransaction, initialStatement, null, kernel ); transactionalContext.check(); verify( kernelTransaction ).assertOpen(); }