### Question:
NetworkDecisionMakerService { public void failed(Endpoint endpoint, long packetId) { failed(endpoint, packetId, now()); } NetworkDecisionMakerService(IDecisionMakerCarrier carrier, long failTimeout, long awaitTime); void discovered(Endpoint endpoint, long packetId, IslInfoData discoveryEvent); void failed(Endpoint endpoint, long packetId); void tick(); void clear(Endpoint endpoint);  }### Answer:
@Test public void failed() { NetworkDecisionMakerService w = new NetworkDecisionMakerService(carrier, 10, 5); w.failed(endpointAlpha, 0L, 0); w.failed(endpointAlpha, 1L, 1); w.failed(endpointAlpha, 2L, 4); verify(carrier, never()).linkDestroyed(any(Endpoint.class)); w.failed(endpointAlpha, 3L, 5); verify(carrier).linkDestroyed(eq(endpointAlpha)); w.discovered(endpointAlpha, 4L, islBetaAlpha, 20); verify(carrier).linkDiscovered(islBetaAlpha); reset(carrier); w.failed(endpointAlpha, 5L, 21); w.failed(endpointAlpha, 6L, 23); w.failed(endpointAlpha, 7L, 24); verify(carrier, never()).linkDestroyed(any(Endpoint.class)); w.failed(endpointAlpha, 8L, 31); verify(carrier).linkDestroyed(eq(endpointAlpha)); }