postOffice.bindQueue("queue4", "topic2", queue4);
postOffice.bindQueue("queue4", "topic2", null, queue4);
   protected void route(boolean persistentMessage) throws Throwable   {      PostOffice postOffice = null;            try      {               postOffice = createPostOffice();               Queue queue1 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding1 =            postOffice.bindQueue("queue1", "topic1", queue1);                  Queue queue2 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding2 =            postOffice.bindQueue("queue2", "topic1", queue2);                  Queue queue3 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding3 =            postOffice.bindQueue("queue3", "topic1", queue3);                  Queue queue4 = new Queue(im.getId(), ms, pm, true, true, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding4 =            postOffice.bindQueue("queue4", "topic2", queue4);                  Queue queue5 = new Queue(im.getId(), ms, pm, true, true, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding5 =            postOffice.bindQueue("queue5", "topic2", queue5);                  Queue queue6 = new Queue(im.getId(), ms, pm, true, true, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding6 =            postOffice.bindQueue("queue6", "topic2", queue6);               SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;         queue1.add(receiver1);         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;         queue2.add(receiver2);         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;         queue3.add(receiver3);         SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;         queue4.add(receiver4);         SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;         queue5.add(receiver5);         SimpleReceiver receiver6 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;         queue6.add(receiver6);                  assertTrue(binding1.isActive());               assertTrue(binding2.isActive());         assertTrue(binding3.isActive());               assertTrue(binding4.isActive());         assertTrue(binding5.isActive());               assertTrue(binding6.isActive());                  Message msg1 = CoreMessageFactory.createCoreMessage(1, persistentMessage, null);               MessageReference ref1 = ms.reference(msg1);                  boolean routed = postOffice.route(ref1, "topic1", null);               assertTrue(routed);                  List msgs = receiver1.getMessages();         assertNotNull(msgs);         assertEquals(1, msgs.size());         Message msgRec = (Message)msgs.get(0);         assertTrue(msg1 == msgRec);         receiver1.acknowledge(msgRec, null);         msgs = queue1.browse();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                  msgs = receiver2.getMessages();         assertNotNull(msgs);         assertEquals(1, msgs.size());         msgRec = (Message)msgs.get(0);         assertTrue(msg1 == msgRec);         receiver2.acknowledge(msgRec, null);         msgs = queue2.browse();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                  msgs = receiver3.getMessages();         assertNotNull(msgs);         assertEquals(1, msgs.size());         msgRec = (Message)msgs.get(0);         assertTrue(msg1 == msgRec);         receiver3.acknowledge(msgRec, null);         msgs = queue3.browse();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                  msgs = receiver4.getMessages();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                  msgs = receiver5.getMessages();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                  msgs = receiver6.getMessages();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                  receiver1.clear();         receiver2.clear();         receiver3.clear();                           Message msg2 = CoreMessageFactory.createCoreMessage(2, persistentMessage, null);               MessageReference ref2 = ms.reference(msg2);                  routed = postOffice.route(ref2, "topic2", null);               assertTrue(routed);                  msgs = receiver4.getMessages();         assertNotNull(msgs);         assertEquals(1, msgs.size());         msgRec = (Message)msgs.get(0);         assertTrue(msg2 == msgRec);         receiver4.acknowledge(msgRec, null);         msgs = queue4.browse();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                  msgs = receiver5.getMessages();         assertNotNull(msgs);         assertEquals(1, msgs.size());         msgRec = (Message)msgs.get(0);         assertTrue(msg2 == msgRec);         receiver5.acknowledge(msgRec, null);         msgs = queue5.browse();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                  msgs = receiver6.getMessages();         assertNotNull(msgs);         assertEquals(1, msgs.size());         msgRec = (Message)msgs.get(0);         assertTrue(msg2 == msgRec);         receiver6.acknowledge(msgRec, null);         msgs = queue6.browse();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                      msgs = receiver1.getMessages();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                  msgs = receiver2.getMessages();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());                  msgs = receiver3.getMessages();         assertNotNull(msgs);         assertTrue(msgs.isEmpty());               }      finally      {         if (postOffice != null)         {            postOffice.stop();         }      }   }