### Question:
BatchTransactionApplierFacade implements BatchTransactionApplier { @Override public TransactionApplier startTx( CommandsToApply transaction ) throws IOException { TransactionApplier[] txAppliers = new TransactionApplier[appliers.length]; for ( int i = 0; i < appliers.length; i++ ) { txAppliers[i] = appliers[i].startTx( transaction ); } return new TransactionApplierFacade( txAppliers ); } BatchTransactionApplierFacade( BatchTransactionApplier... appliers ); @Override TransactionApplier startTx( CommandsToApply transaction ); @Override TransactionApplier startTx( CommandsToApply transaction, LockGroup lockGroup ); @Override void close();  }### Answer:
@Test public void testStartTxCorrectOrder() throws Exception { TransactionToApply tx = mock( TransactionToApply.class ); TransactionApplierFacade result = (TransactionApplierFacade) facade.startTx( tx ); InOrder inOrder = inOrder( applier1, applier2, applier3 ); inOrder.verify( applier1 ).startTx( tx ); inOrder.verify( applier2 ).startTx( tx ); inOrder.verify( applier3 ).startTx( tx ); assertEquals( txApplier1, result.appliers[0] ); assertEquals( txApplier2, result.appliers[1] ); assertEquals( txApplier3, result.appliers[2] ); assertEquals( 3, result.appliers.length ); }
@Test public void testStartTxCorrectOrderWithLockGroup() throws Exception { TransactionToApply tx = mock( TransactionToApply.class ); LockGroup lockGroup = mock( LockGroup.class ); TransactionApplierFacade result = (TransactionApplierFacade) facade.startTx( tx, lockGroup ); InOrder inOrder = inOrder( applier1, applier2, applier3 ); inOrder.verify( applier1 ).startTx( tx, lockGroup ); inOrder.verify( applier2 ).startTx( tx, lockGroup ); inOrder.verify( applier3 ).startTx( tx, lockGroup ); assertEquals( txApplier1, result.appliers[0] ); assertEquals( txApplier2, result.appliers[1] ); assertEquals( txApplier3, result.appliers[2] ); assertEquals( 3, result.appliers.length ); }