### Question:
OpsListener implements DOMRpcAvailabilityListener, DOMActionAvailabilityExtension.AvailabilityListener { @Override public void onRpcUnavailable(final Collection<DOMRpcIdentifier> rpcs) { checkArgument(rpcs != null, "Input Collection of DOMRpcIdentifier can not be null."); LOG.debug("Removing registration for [{}]", rpcs); rpcRegistry.tell(new RemoveRoutes(rpcs), ActorRef.noSender()); } OpsListener(final ActorRef rpcRegistry, final ActorRef actionRegistry); @Override void onRpcAvailable(final Collection<DOMRpcIdentifier> rpcs); @Override void onRpcUnavailable(final Collection<DOMRpcIdentifier> rpcs); @Override boolean acceptsImplementation(final DOMRpcImplementation impl); @Override boolean acceptsImplementation(final DOMActionImplementation impl); @Override void onActionsChanged(final Set<DOMActionInstance> removed, final Set<DOMActionInstance> added);  }### Answer:
@Test public void testRouteRemove() { final TestKit probeReg = new TestKit(SYSTEM); final ActorRef rpcRegistry = probeReg.getRef(); final OpsListener opsListener = new OpsListener(rpcRegistry, rpcRegistry); opsListener.onRpcUnavailable(Collections.singleton(RPC_ID)); probeReg.expectMsgClass(RpcRegistry.Messages.RemoveRoutes.class); }