@Before
  public void init() throws Exception {
    networkingService.start();

    verify(discoveryService).addLanDiscoveryListener(networkingService);
    when(acceptor.isOpen()).thenReturn(true);
    networkingService.addMessageListener(listener);
    when(nodeFactory.newNode(anyString())).thenReturn(lanNode);
    when(localInetAddress.getHostAddress()).thenReturn(localAddress);
    when(lanNode.getConnection()).thenReturn(connection);
    when(connection.getLocalAddress()).thenReturn(localInetAddress);
    when(connection.getRemoteAddress()).thenReturn(remoteInetAddress);
  }