((Peer)channel).join(); ((Peer)channel2).join();
((DistributedChannel)channel).join(); ((DistributedChannel)channel2).join();
   public void testRecoverableDistributedChannel_32() throws Throwable   {      if (!channel.isRecoverable())      {         // we test only recoverable channels now         return;      }      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();      // add an NACKING receiver to the remote channel peer      SimpleReceiver r = new SimpleReceiver("NackingReceiver", SimpleReceiver.NACKING);      assertTrue(channel2.add(r));      assertFalse(channel.iterator().hasNext());      SimpleDeliveryObserver observer = new SimpleDeliveryObserver();      Transaction tx = tr.createTransaction();      Message[] messages = new Message[NUMBER_OF_MESSAGES];      for(int i = 0; i < NUMBER_OF_MESSAGES; i++)      {         messages[i] = Factory.createMessage("message" + i, true, "payload" + i);         // transacted send, reliable message, multiple messages         // for a transactional send, handle() return value is unspecified         channel.handle(observer, messages[i], tx);      }      // no messages in the channel yet      assertEquals(0, channel.browse().size());      assertEquals(0, channel2.browse().size());      // no message at the receiver      assertTrue(r.getMessages().isEmpty());      tx.commit();      assertEqualSets(messages, channel.browse());      assertEqualSets(messages, channel2.browse());      assertEqualSets(messages, r.getMessages());      for(Iterator i = r.getMessages().iterator(); i.hasNext();)      {         Message ackm = (Message)i.next();         // non-transacted acknowledgment         r.acknowledge(ackm, null);      }      assertTrue(channel.browse().isEmpty());      assertTrue(channel2.browse().isEmpty());   }