### Question:
AutoDiscovery implements Discovery { @Override public void onDisconnect(URI nodeUri) { networkStore.remove(NodeUri.create(nodeUri)); } AutoDiscovery(NetworkStore networkStore); @Override void onUpdate(final NodeInfo nodeInfo); @Override void onDisconnect(URI nodeUri);  }### Answer:
@Test public void onDisconnect() { URI uri = URI.create("http: List<NodeUri> results = new ArrayList<>(); doAnswer(invocation -> { results.add(invocation.getArgument(0)); return null; }).when(networkStore).remove(any(NodeUri.class)); discovery.onDisconnect(uri); assertThat(results).containsExactly(NodeUri.create(uri)); verify(networkStore).remove(any(NodeUri.class)); }