### Question:
NodeManager implements INodeManager { @Override public synchronized boolean leaveNetwork() { if (node != null) { boolean res = node.disconnect(); node = null; notifyDisconnect(); return res; } return true; } @Inject  NodeManager(final MessageBus messageBus); @Override synchronized boolean joinNetwork(List<String> bootstrappingNodes); @Override synchronized boolean joinNetwork(final String address); @Override synchronized boolean createNetwork(); @Override synchronized boolean leaveNetwork(); @Override boolean isConnected(); @Override IH2HNode getNode(); @Override INetworkConfiguration getNetworkConfiguration(); @Override IFileConfiguration getFileConfiguration();  }### Answer:
@Test public void testLeaveNetwork_NotConnected() { boolean ret = nodeManager.leaveNetwork(); assertTrue(ret); Mockito.verify(messageBus, Mockito.never()).publish(Mockito.anyObject()); }