((Peer)channel).join(); ((Peer)channel2).join();
((DistributedChannel)channel).join(); ((DistributedChannel)channel2).join();
   public void testRemoteBrowse() throws Exception   {      jchannel2.connect("testGroup");      // allow the group time to form      Thread.sleep(1000);      assertTrue(jchannel.isConnected());      assertTrue(jchannel2.isConnected());      // make sure both jchannels joined the group      assertEquals(2, jchannel.getView().getMembers().size());      assertEquals(2, jchannel2.getView().getMembers().size());      ((Peer)channel).join();      ((Peer)channel2).join();      // the channel has no receivers      assertFalse(channel.iterator().hasNext());      assertFalse(channel2.iterator().hasNext());      SimpleDeliveryObserver observer = new SimpleDeliveryObserver();      Message red = Factory.createMessage("message0", false, "payload0");      red.putHeader("color", "red");      Message green = Factory.createMessage("message1", false, "payload1");      green.putHeader("color", "green");      // non-transacted send, non-reliable message, one message      assertTrue(channel.handle(observer, red, null).isDone());      assertTrue(channel.handle(observer, green, null).isDone());      Filter redFilter = new SimpleFilter("color", "red");      List messages = channel2.browse(redFilter);      assertEquals(1, messages.size());      Message m = (Message)messages.get(0);      assertEquals("message0", m.getMessageID());      assertEquals("payload0", m.getPayload());   }