@Test
public void testGetTransaction() throws Exception {

  final Transaction transaction = channel.getTransaction();
  executor.submit(new Runnable() {
      @Override
      public void run() {
        Assert.assertNotSame(transaction, channel.getTransaction());
      }
    }).get();
  Assert.assertSame(transaction, channel.getTransaction());
  transaction.begin();
  executor.submit(new Runnable() {
      @Override
      public void run() {
        Assert.assertNotSame(transaction, channel.getTransaction());
      }
    }).get();
  Assert.assertSame(transaction, channel.getTransaction());
  transaction.commit();
  executor.submit(new Runnable() {
      @Override
      public void run() {
        Assert.assertNotSame(transaction, channel.getTransaction());
      }
    }).get();
  Assert.assertSame(transaction, channel.getTransaction());
  transaction.close();
  executor.submit(new Runnable() {
      @Override
      public void run() {
        Assert.assertNotSame(transaction, channel.getTransaction());
      }
    }).get();
  Assert.assertNotSame(transaction, channel.getTransaction());
}