### Question:
KunderaJTAUserTransaction implements UserTransaction, Referenceable, Serializable { @Override public void rollback() throws IllegalStateException, SecurityException, SystemException { try { Transaction tx = threadLocal.get(); if (tx == null) { throw new IllegalStateException("Cannot locate a Transaction for rollback."); } if (log.isDebugEnabled()) log.info("Rollback transaction:" + tx); tx.rollback(); } finally { if (log.isDebugEnabled()) log.info("Resetting after rollback."); threadLocal.set(null); timerThead.set(null); } } KunderaJTAUserTransaction(); static KunderaJTAUserTransaction getCurrentTx(); @Override void begin(); @Override void commit(); @Override int getStatus(); @Override void rollback(); @Override void setRollbackOnly(); @Override void setTransactionTimeout(int timeout); int getTransactionTimeout(); void setImplementor(ResourceManager implementor); @Override Reference getReference();  }### Answer:
@Test public void testRollback() { try { Assert.assertNotNull(utx); Assert.assertSame(KunderaJTAUserTransaction.class, utx.getClass()); try { utx.rollback(); Assert.fail("Should have gone to catch block1"); } catch (IllegalStateException isex) { Assert.assertEquals("Cannot locate a Transaction for rollback.", isex.getMessage()); } utx.begin(); Assert.assertEquals(Status.STATUS_ACTIVE, utx.getStatus()); utx.rollback(); Assert.assertEquals(Status.STATUS_NO_TRANSACTION, utx.getStatus()); } catch (NotSupportedException nsuex) { Assert.fail(nsuex.getMessage()); } catch (SystemException ex) { Assert.fail(ex.getMessage()); } }