final HazelcastInstance instance = createHazelcastInstanceFactory(1).newHazelcastInstance();
final String item = "offered";
final String queueName = "testTransactionalOfferAndPollWithTimeout";
final TransactionContext context = instance.newTransactionContext();
context.beginTransaction();
TransactionalQueue<String> txnQueue = context.getQueue(queueName);
assertTrue(txnQueue.offer(item));
assertEquals(1, txnQueue.size());
assertEquals(item, txnQueue.poll(5, TimeUnit.SECONDS));
context.commitTransaction();