### Question:
TransactionHandle implements TransactionTerminationHandle { public void rollback( ExecutionResultSerializer output ) { List<Neo4jError> errors = new LinkedList<>(); try { ensureActiveTransaction(); rollback( errors ); } catch ( InternalBeginTransactionError e ) { errors.add( e.toNeo4jError() ); } finally { output.errors( errors ); output.finish(); } } TransactionHandle( TransitionalPeriodTransactionMessContainer txManagerFacade, QueryExecutionEngine engine,
            GraphDatabaseQueryService queryService, TransactionRegistry registry, TransactionUriScheme uriScheme,
            boolean implicitTransaction, LoginContext loginContext, long customTransactionTimeout,
            LogProvider logProvider ); URI uri(); boolean isImplicit(); void execute( StatementDeserializer statements, ExecutionResultSerializer output,
            HttpServletRequest request ); @Override boolean terminate(); void commit( StatementDeserializer statements, ExecutionResultSerializer output, HttpServletRequest request ); void rollback( ExecutionResultSerializer output );  }### Answer:
@Test public void shouldRollbackTransactionAndTellRegistryToForgetItsHandle() { TransitionalPeriodTransactionMessContainer kernel = mockKernel(); TransitionalTxManagementKernelTransaction transactionContext = kernel.newTransaction( explicit, AUTH_DISABLED, -1 ); TransactionRegistry registry = mock( TransactionRegistry.class ); when( registry.begin( any( TransactionHandle.class ) ) ).thenReturn( 1337L ); GraphDatabaseQueryService queryService = mock( GraphDatabaseQueryService.class ); TransactionHandle handle = new TransactionHandle( kernel, mock( QueryExecutionEngine.class ), queryService, registry, uriScheme, true, AUTH_DISABLED, anyLong(), NullLogProvider.getInstance() ); ExecutionResultSerializer output = mock( ExecutionResultSerializer.class ); handle.rollback( output ); InOrder transactionOrder = inOrder( transactionContext, registry ); transactionOrder.verify( transactionContext ).rollback(); transactionOrder.verify( registry ).forget( 1337L ); InOrder outputOrder = inOrder( output ); outputOrder.verify( output ).errors( argThat( hasNoErrors() ) ); outputOrder.verify( output ).finish(); verifyNoMoreInteractions( output ); }