MulticastNetworker implements Networker { @Override public Group lookup(URL url) throws RemotingException { return new MulticastGroup(url); }  @Override Group lookup(URL url);  }
@Test public void testJoin() throws RemotingException, InterruptedException { final String groupURL = "multicast: final String peerURL = "exchange: final CountDownLatch countDownLatch = new CountDownLatch(1); Peer peer1 = Networkers.join(groupURL, peerURL, new ChannelHandlerAdapter() { @Override public void received(Channel channel, Object message) { countDownLatch.countDown(); } }); Peer peer2 = Networkers.join(groupURL, "exchange: mock(ChannelHandlerAdapter.class)); while (true) { long count = countDownLatch.getCount(); if (count > 0) { break; } for (Channel channel : peer1.getChannels()) { channel.send("hello world!"); } TimeUnit.MILLISECONDS.sleep(50); } Group lookup = Networkers.lookup(groupURL); assertThat(lookup, not(nullValue())); peer2.close(); peer1.close(); }