### Question:
TransactionManagementImpl implements TransactionManagement { @Override public void rollbackTransaction(long txId) throws BagriException { logger.trace("rollbackTransaction.enter; current txId: {}", this.txId); if (this.txId != txId) { throw new BagriException("Wrong transaction id: " + txId + "; current txId is: " + this.txId, BagriException.ecTransWrongState); } boolean result = false; TransactionAborter txa = new TransactionAborter(clientId, this.txId); Future<Boolean> future = execService.submitToKeyOwner(txa, clientId); try { result = future.get(); this.txId = TX_NO; } catch (InterruptedException | ExecutionException ex) { this.txId = TX_NO; logger.error("rollbackTransaction; error getting result", ex); throw new BagriException(ex, BagriException.ecTransaction); } logger.trace("rollbackTransaction.exit; rolled back: {}", result); }  long getTransactionTimeout(); void setTransactionTimeout(long timeout); @Override boolean isInTransaction(); @Override long beginTransaction(); @Override long beginTransaction(TransactionIsolation txIsolation); @Override void commitTransaction(long txId); @Override void rollbackTransaction(long txId); @Override boolean finishCurrentTransaction(boolean rollback);  }### Answer:
@Test public void rollbackTransactionTest() throws Exception { long txId = xRepo.getTxManagement().beginTransaction(); try { storeSecurityTest(); ResultCursor<XQItemAccessor> sec = getSecurity("VFINX"); Assert.assertNotNull(sec); Assert.assertFalse(sec.isEmpty()); sec.close(); sec = getSecurity("IBM"); Assert.assertNotNull(sec); Assert.assertFalse(sec.isEmpty()); sec.close(); sec = getSecurity("PTTAX"); Assert.assertNotNull(sec); Assert.assertFalse(sec.isEmpty()); sec.close(); xRepo.getTxManagement().rollbackTransaction(txId); txId = 0; sec = getSecurity("VFINX"); Assert.assertNotNull(sec); Assert.assertTrue(sec.isEmpty()); sec.close(); sec = getSecurity("IBM"); Assert.assertNotNull(sec); Assert.assertTrue(sec.isEmpty()); sec.close(); sec = getSecurity("PTTAX"); Assert.assertNotNull(sec); Assert.assertTrue(sec.isEmpty()); sec.close(); } finally { if (txId > 0) { xRepo.getTxManagement().rollbackTransaction(txId); } } }