Jta { public static UserTransaction getUserTransaction() { synchronized (initLock) { if (!Jta.frozen) { throw new IllegalStateException("JTA configuration must be frozen before retrieving UserTransaction from this class."); } } return Jta.userTransaction; } private  Jta(); static void configure(TransactionManager transactionManager, UserTransaction userTransaction); static void reset(); static boolean isFrozen(); static boolean isEnabled(); static TransactionManager getTransactionManager(); static UserTransaction getUserTransaction();  }
@Test public void testGetUserTransaction() throws Exception { Jta.configure(transactionManager, userTransaction); assertTrue(Jta.isFrozen()); assertSame(userTransaction, Jta.getUserTransaction()); }