### Question:
LocalTransaction { public void rollback() { rollbackInternal("rollback"); } protected  LocalTransaction(
      DataSource dataSource,
      ThreadLocal<LocalTransactionContext> localTxContextHolder,
      JdbcLogger jdbcLogger); protected  LocalTransaction(
      DataSource dataSource,
      ThreadLocal<LocalTransactionContext> localTxContextHolder,
      JdbcLogger jdbcLogger,
      TransactionIsolationLevel defaultTransactionIsolationLevel); void begin(); void begin(TransactionIsolationLevel transactionIsolationLevel); void commit(); LocalTransactionContext suspend(); void resume(LocalTransactionContext context); void rollback(); void setSavepoint(String savepointName); boolean hasSavepoint(String savepointName); void releaseSavepoint(String savepointName); void rollback(String savepointName); @Override String toString(); boolean isActive(); void setRollbackOnly(); boolean isRollbackOnly();  }### Answer:
@Test public void testRollback() { transaction.begin(); dataSource.getConnection(); transaction.rollback(); assertFalse(transaction.isActive()); assertTrue(connection.autoCommit); assertTrue(connection.rolledback); }
@Test public void testRollback_notYetBegun() { transaction.rollback(); }
@Test public void testRollbackSavepoint_notYetBegun() { try { transaction.rollback("hoge"); } catch (TransactionNotYetBegunException expected) { System.out.println(expected.getMessage()); } }