### Question:
LocalTransaction { public boolean hasSavepoint(String savepointName) { if (savepointName == null) { rollbackInternal("hasSavepoint"); throw new DomaNullPointerException("savepointName"); } LocalTransactionContext context = localTxContextHolder.get(); if (!isActiveInternal(context)) { throw new TransactionNotYetBegunException(Message.DOMA2057, savepointName); } return context.getSavepoint(savepointName) != null; } 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 testHasSavepoint() { transaction.begin(); assertFalse(transaction.hasSavepoint("hoge")); transaction.setSavepoint("hoge"); assertTrue(transaction.isActive()); assertFalse(connection.autoCommit); assertTrue(transaction.hasSavepoint("hoge")); }
@Test public void testHasSavepoint_notYetBegun() { try { transaction.hasSavepoint("hoge"); fail(); } catch (TransactionNotYetBegunException expected) { System.out.println(expected.getMessage()); } }