final HazelcastInstance instance1 = factory.newHazelcastInstance();
final HazelcastInstance instance2 = factory.newHazelcastInstance();
final TransactionContext context = instance1.newTransactionContext();
context.beginTransaction();
TransactionalQueue txnQ1 = context.getQueue("testQueueOfferCommitSize");
TransactionalQueue txnQ2 = context.getQueue("testQueueOfferCommitSize");
txnQ1.offer("item");
assertEquals(1, txnQ1.size());
assertEquals(1, txnQ2.size());
context.commitTransaction();
assertEquals(1, instance1.getQueue("testQueueOfferCommitSize").size());
assertEquals(1, instance2.getQueue("testQueueOfferCommitSize").size());
assertEquals("item", instance2.getQueue("testQueueOfferCommitSize").poll());