### Question:
ConsumedThingEvent extends ThingEvent<T> { public Observable<Optional<T>> observer() throws ConsumedThingException { try { Pair<ProtocolClient, Form> clientAndForm = thing.getClientFor(getForms(), Operation.SUBSCRIBE_EVENT); ProtocolClient client = clientAndForm.first(); Form form = clientAndForm.second(); return client.observeResource(form) .map(content -> Optional.ofNullable(ContentManager.contentToValue(content, getData()))); } catch (ProtocolClientException e) { throw new ConsumedThingException(e); } } ConsumedThingEvent(String name, ThingEvent<T> event, ConsumedThing thing); Observable<Optional<T>> observer(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }### Answer:
@Test public void subscribeShouldCallUnderlyingClient() throws ConsumedThingException, ProtocolClientException { when(thing.getClientFor(any(List.class), any())).thenReturn(new Pair(client, form)); when(form.getHref()).thenReturn("test:/myAction"); when(client.observeResource(any())).thenReturn(observable); ConsumedThingEvent<Object> consumedThingEvent = new ConsumedThingEvent<Object>("myEvent", event, thing); consumedThingEvent.observer().subscribe(observer); verify(client).observeResource(any()); }