office.bindQueue("queue7", "condition2", queue7);
office.bindQueue("queue7", "condition2", null, queue7);
   public final void testListBindings() throws Throwable   {      PostOffice office = null;            try      {               office = createPostOffice();                  Queue queue1 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding1 =            office.bindQueue("queue1", "condition1", queue1);                  Queue queue2 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding2 =            office.bindQueue("queue2", "condition1", queue2);                  Queue queue3 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding3 =            office.bindQueue("queue3", "condition1", queue3);                  Queue queue4 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding4 =            office.bindQueue("queue4", "condition1", queue4);                  Queue queue5 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding5 =            office.bindQueue("queue5", "condition2", queue5);                  Queue queue6 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding6 =            office.bindQueue("queue6", "condition2", queue6);                  Queue queue7 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding7 =            office.bindQueue("queue7", "condition2", queue7);                  Queue queue8 = new Queue(im.getId(), ms, pm, true, false, 2000, 100, 100, (QueuedExecutor)pool.get(), null);                  Binding binding8 =            office.bindQueue("queue8", "condition2", queue8);                           List bindings = office.listBindingsForCondition("dummy");         assertNotNull(bindings);         assertTrue(bindings.isEmpty());                  //We don't match on substrings         bindings = office.listBindingsForCondition("condition123");         assertNotNull(bindings);         assertTrue(bindings.isEmpty());                  //We don't currently support hierarchies         bindings = office.listBindingsForCondition("condition1.subcondition");         assertNotNull(bindings);         assertTrue(bindings.isEmpty());                  //We currently just do an exact match         bindings = office.listBindingsForCondition("condition1");         assertNotNull(bindings);         assertEquals(4, bindings.size());                  assertEquivalent((Binding)bindings.get(0), binding1);         assertEquivalent((Binding)bindings.get(1), binding2);         assertEquivalent((Binding)bindings.get(2), binding3);         assertEquivalent((Binding)bindings.get(3), binding4);                  bindings = office.listBindingsForCondition("condition2");         assertNotNull(bindings);         assertEquals(4, bindings.size());                  assertEquivalent((Binding)bindings.get(0), binding5);         assertEquivalent((Binding)bindings.get(1), binding6);         assertEquivalent((Binding)bindings.get(2), binding7);         assertEquivalent((Binding)bindings.get(3), binding8);      }      finally      {         if (office != null)         {            office.stop();         }      }            }