IQueue q = getQueue();
q.offer("item1");
q.offer("item2");
q.offer("item3");
q.offer("item4");
q.offer("item5");
final SimpleClient client = getClient();
client.send(new DrainRequest(queueName, 1));
PortableCollection result = (PortableCollection) client.receive();
Collection<Data> coll = result.getCollection();