### Question:
IndexBatchTransactionApplier extends BatchTransactionApplier.Adapter { @Override public TransactionApplier startTx( CommandsToApply transaction ) { txId = transaction.transactionId(); return transactionApplier; } IndexBatchTransactionApplier( IndexingService indexingService, WorkSync<Supplier<LabelScanWriter>,LabelUpdateWork> labelScanStoreSync,
            WorkSync<IndexingUpdateService,IndexUpdatesWork> indexUpdatesSync, NodeStore nodeStore, RelationshipStore relationshipStore,
            PropertyStore propertyStore, IndexActivator indexActivator ); @Override TransactionApplier startTx( CommandsToApply transaction ); @Override void close();  }### Answer:
@Test public void shouldProvideLabelScanStoreUpdatesSortedByNodeId() throws Exception { IndexingService indexing = mock( IndexingService.class ); when( indexing.convertToIndexUpdates( any(), eq( EntityType.NODE ) ) ).thenAnswer( o -> Iterables.empty() ); LabelScanWriter writer = new OrderVerifyingLabelScanWriter( 10, 15, 20 ); WorkSync<Supplier<LabelScanWriter>,LabelUpdateWork> labelScanSync = spy( new WorkSync<>( singletonProvider( writer ) ) ); WorkSync<IndexingUpdateService,IndexUpdatesWork> indexUpdatesSync = new WorkSync<>( indexing ); TransactionToApply tx = mock( TransactionToApply.class ); PropertyStore propertyStore = mock( PropertyStore.class ); try ( IndexBatchTransactionApplier applier = new IndexBatchTransactionApplier( indexing, labelScanSync, indexUpdatesSync, mock( NodeStore.class ), mock( RelationshipStore.class ), propertyStore, new IndexActivator( indexing ) ) ) { try ( TransactionApplier txApplier = applier.startTx( tx ) ) { txApplier.visitNodeCommand( node( 15 ) ); txApplier.visitNodeCommand( node( 20 ) ); txApplier.visitNodeCommand( node( 10 ) ); } } verify( labelScanSync ).applyAsync( any() ); }