@Test
  public void testAddNullTransaction() throws Exception {
    try {
      utx.begin();
      GlobalTransaction gtx = tm.getGlobalTransaction();
      Transaction txn = null;
      gtx.addTransaction(txn);
      utx.commit();
      fail("SystemException not thrown on adding null transaction");
    } catch (SystemException e) {
      utx.commit();
    }
  }
Check if the correct expectations are being thrown when they are supposed to.
geode-core/src/integrationTest/java/org/apache/geode/internal/jta/ExceptionJUnitTest.java