for(Message msg: msgs)
batch.add(msg);
System.out.println("batch = " + batch);
assert batch.size() == prev_size;
assert batch.capacity() == prev_size;
}
public void testRemoveWithFilter() {
Filter<Message> filter=new Filter<Message>() {
public boolean accept(Message msg) {return msg != null && msg.isTransientFlagSet(Message.TransientFlag.OOB_DELIVERED);}