### Question:
LocalTransaction { public void releaseSavepoint(String savepointName) { if (savepointName == null) { rollbackInternal("releaseSavepoint"); throw new DomaNullPointerException("savepointName"); } LocalTransactionContext context = localTxContextHolder.get(); if (!isActiveInternal(context)) { throw new TransactionNotYetBegunException(Message.DOMA2061, savepointName); } String id = context.getId(); Savepoint savepoint = context.releaseAndGetSavepoint(savepointName); if (savepoint == null) { rollbackInternal("releaseSavepoint"); throw new SavepointNotFoundException(savepointName); } LocalTransactionConnection connection = context.getConnection(); try { connection.releaseSavepoint(savepoint); } catch (SQLException e) { rollbackInternal("releaseSavepoint"); throw new JdbcException(Message.DOMA2060, e, savepointName, e); } jdbcLogger.logTransactionSavepointReleased(className, "releaseSavepoint", id, savepointName); } 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 testReleaseSavepoint() { transaction.begin(); transaction.setSavepoint("hoge"); transaction.setSavepoint("foo"); transaction.setSavepoint("bar"); transaction.releaseSavepoint("foo"); assertTrue(transaction.isActive()); assertFalse(connection.autoCommit); assertFalse(connection.savepointNames.contains("hoge")); assertFalse(connection.savepointNames.contains("foo")); assertTrue(connection.savepointNames.contains("bar")); }
@Test public void testReleaseSavepoint_notYetBegun() { try { transaction.releaseSavepoint("hoge"); fail(); } catch (TransactionNotYetBegunException expected) { System.out.println(expected.getMessage()); } }