### Question:
AkkaProtocolClient implements ProtocolClient { @Override public Observable<Thing> discover(ThingFilter filter) throws ProtocolClientNotImplementedException { if (system.settings().config() != null && system.settings().config().getStringList("wot.servient.akka.extensions").contains("akka.cluster.pubsub.DistributedPubSub")) { return Observable.using( () -> { log.debug("Create temporary actor to discover things matching filter: {}", filter); PublishSubject<Thing> subject = PublishSubject.create(); ActorRef actorRef = system.actorOf(DiscoverActor.props(subject, filter, discoverTimeout)); return new Pair<>(subject, actorRef); }, Pair::first, pair -> { log.debug("No more observers. Stop temporary actor for thing discovery with filter: {}", filter); system.stop(pair.second()); } ); } else { log.warn("DistributedPubSub extension missing. ANY Discovery is not be supported."); throw new ProtocolClientNotImplementedException(getClass(), "discover"); } } AkkaProtocolClient(ActorSystem system,
                              Duration askTimeout,
                              Duration discoverTimeout);   AkkaProtocolClient(ActorSystem system,
                       Duration askTimeout,
                       Duration discoverTimeout,
                       AkkaProtocolPattern pattern); @SuppressWarnings("squid:S1192") @Override CompletableFuture<Content> readResource(Form form); @Override CompletableFuture<Content> writeResource(Form form, Content content); @Override CompletableFuture<Content> invokeResource(Form form, Content content); @Override Observable<Content> observeResource(Form form); @Override Observable<Thing> discover(ThingFilter filter);  }### Answer:
@Test(expected = ProtocolClientNotImplementedException.class) public void discoverShouldThrowException() throws ProtocolClientNotImplementedException { when(form.getHref()).thenReturn("akka: when(system.actorSelection(anyString())).thenReturn(actorSelection); when(pattern.ask(any(ActorSelection.class), any(), any())).thenReturn(completedFuture(message)); AkkaProtocolClient client = new AkkaProtocolClient(system, askTimeout, discoverTimeout, pattern); client.discover(filter); }