Set destinations = (Set)ServerManagement.invoke(serverPeerObjectName, "getDestinations", new Object[0], new String[0]);
Set destinations = (Set)ServerManagement.getAttribute(serverPeerObjectName, "Destinations");
   public void testDeployDestinationAdministratively() throws Exception   {      ObjectName serverPeerObjectName = ServerManagement.getServerPeerObjectName();      String config =         "<mbean code=\"org.jboss.jms.server.destination.@TOREPLACE@\" " +         "       name=\"somedomain:service=@TOREPLACE@,name=Kirkwood\"" +         "       xmbean-dd=\"xmdesc/@TOREPLACE@-xmbean.xml\">" +         "    <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>" +         "</mbean>";      config = adjustConfiguration(config);      ObjectName destObjectName = deploy(config);      assertEquals("Kirkwood", ServerManagement.getAttribute(destObjectName, "Name"));      String jndiName = (isQueue() ? "/queue" : "/topic") + "/Kirkwood";      String s = (String)ServerManagement.getAttribute(destObjectName, "JNDIName");      assertEquals(jndiName, s);      Set destinations = (Set)ServerManagement.invoke(serverPeerObjectName, "getDestinations",                                                      new Object[0], new String[0]);      assertEquals(1, destinations.size());      if (isQueue())      {         Queue q = (Queue)destinations.iterator().next();         assertEquals("Kirkwood", q.getQueueName());      }      else      {         Topic t = (Topic)destinations.iterator().next();         assertEquals("Kirkwood", t.getTopicName());      }      assertEquals(serverPeerObjectName,                   ServerManagement.getAttribute(destObjectName, "ServerPeer"));      // try to change it      ServerManagement.setAttribute(destObjectName, "ServerPeer",                                    "theresnosuchdomain:service=TheresNoSuchService");      assertEquals(serverPeerObjectName,                   ServerManagement.getAttribute(destObjectName, "ServerPeer"));      undeployDestination((String)ServerManagement.getAttribute(destObjectName, "Name"));   }